Manuel Bernhardt
Manuel Bernhardt

Reputation: 3144

Skip tests on checkout during maven release:perform

During the maven release:perform goal, the prepared tag is being checked out from SCM and a build seems to be attempted in a forked maven instance.

I'd like the tests to be skipped at that point, because for whatever reason, they fail (the build involves running a test web-application via cargo, and I believe this just doesn't work well in this environment).

Is there any way to instruct maven to do this?

Upvotes: 3

Views: 2658

Answers (1)

Martin Ellis
Martin Ellis

Reputation: 9651

You can specify arguments to the forked maven instance on the command line:

mvn release:prepare -Darguments="-DskipTests"
mvn release:perform -Darguments="-DskipTests"

or specify a maven-release-plugin configuration in your pom, perhaps under pluginManagement:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-release-plugin</artifactId>
      <configuration>
        <arguments>-DskipTests</arguments>
      </configuration>
    </plugin>

Upvotes: 11

Related Questions