Question

I'm trying to use the mvn scm plugin to check out the daily tag, and create an assembly from that version of the code. I configured the scm plugin and everythhing is working well, except that I can not seem to tell it to not run the unittests.

I tried:

  • Passing the -Dmaven.test.skip=true command line parameter
  • Creating a profile where the surefire plugin skips test, and list that profile in the scm configuration "profiles" section
  • setting the "maven.test.skip=true" as an environment variable

In all cases, when the scm plugin starts running the goals I told it to run in the configuration (see below), it also runs the unittests.

Below is the example I used to skip tests by using a profile:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-scm-plugin</artifactId>
    <version>1.0</version>
    <configuration>
        <goals>install,assembly:assembly</goals>
        <profiles>skiptest</profiles>
    </configuration>
</plugin>

And this is the profile (I defined this in the pom.xml of the project):

<profiles>
    <profile>
        <id>skiptest</id>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

The command I use to do the checkout and bootstrap is:

mvn scm:bootstrap -DscmVersion=daily-20110427-421 -DscmVersionType=tag

I'm running mvn 2.2.1 on a Linux machine, and doing a checkout from a CVS repository. It's an existing project, I have continuous integration and tagging all up and running, I just want to check out a daily tag and create an assembly from that.

Any tips are much appreciated.

Edit: Got it to work with the answer below, but only after I upgraded to maven-scm-plugin version 1.1. Apparently, 1.0 did not propagate profiles.

Was it helpful?

Solution

Try this in the profile:

<profiles>
    <profile>
        <id>skiptest</id>
        <properties>
            <maven.test.skip>true</maven.test.skip>
        </properties>
    </profile>
</profiles>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top