It's a little hackish, but if you have a profile that's activeByDefault, and
you want to disable it deliberately, then you can create an empty, dummy
profile, and activate that. So:

<profile>
 <id>dummy</id>
</profile>

then:

mvn -P dummy <goals>

Good luck,

-john

On 5/9/07, James Abley <[EMAIL PROTECTED]> wrote:

I have a situation like this as well.

My use case is the maven release plugin and cargo. For day to day
builds, I want to use cargo to deploy the latest version of a war file
to my web container. During the release, the build falls over during
the cargo undeploy step due to the incremented version number of the
POM, which is part of the war file name.

So during a release, I wanted to disable cargo.

mvn release:prepare -Dcargo=false ...

This was the closest I found:

http://www.nabble.com/Skipping-cargo-tf2761726.html#a7702937

A concrete example would be be handy! I've tried the below, but it
doesn't work - the cargo plugin doesn't get called.

    <profiles>
        <profile>
            <!--
                To disable the cargo plugin to undeploy and deploy to
Tomcat,
                use -Dcargo=false, or not 'true' as part of the mvn
command line.
            -->
            <activation>
                <property>
                    <name>cargo</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                        <artifactId>cargo-maven2-plugin</artifactId>
                        <configuration>
                            <deployer>
                                <deployables>
                                    <deployable>
                                        <artifactId>
                                            ${pom.artifactId}
                                        </artifactId>
                                        <groupId>
                                            ${pom.groupId}
                                        </groupId>
                                    </deployable>
                                </deployables>
                            </deployer>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <properties>
        <!-- enable cargo profile by default -->
        <cargo>true</cargo>
    </properties>

Cheers,

James

On 08/05/07, David Corbin <[EMAIL PROTECTED]> wrote:
> Twice this week for two seperate reasons, I've wanted to use profiles
where it
> was active by default, but it would be possible to de-activate it based
on
> property.
>
> I don't see anyway to do this.  Am I missing something?
>
> Thanks
> David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
John Casey
---
Maven Developer (http://maven.apache.org)
---
Blog: http://www.ejlife.net/blogs/buildchimp

Reply via email to