Want to just type mvn
on the command-line instead of mvn clean verify
every time?
Add the following to your pom.xml
:
<project>
<build>
<defaultGoal>clean verify</defaultGoal>
</build>
</project>
To run a single test from the command-line, use:
$ mvn -Dtest=ClassName#methodName test
In the execution
element to assign the goal
used by the plug-in to the phase none
.
<profiles>
<profile>
<id>skipStuff</id>
<build>
<plugins>
<plugin>
<groupId>com.cj.jshintmojo</groupId>
<artifactId>jshint-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<goals>
<goal>lint</goal>
</goals>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Sometimes you want to use a plugin without inheriting the configuration from the non-profile plugin configuration.
To do this, set the combine.self
attribute to override
in the plugin's configuration
element.
<profiles>
<profile>
<id>frenemy</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration combine.self="override">
<includes>
<include>**/foo/frenemy/**/*.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
$ dependency:tree
$ mvn dependency:resolve-plugins
Run gradle init
in the same directory as your pom.xml
.
This will generate build.gradle
and gradle.settings
files.
<project>
<properties>
<integrationForkCount>8</integrationForkCount>
</properties>
</project>
<project>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<forkCount>${integrationForkCount}</forkCount>
<reuseForks>false</reuseForks>
<argLine>-Xmx1024m</argLine>
<argLine>-XX:MaxPermSize=256m</argLine>
<useFile>false</useFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
$ mvn -DintegrationForkCount=2 verify
Set MAVEN_OPTS
in your shell's configuration script. For example:
export MAVEN_OPTS=-DintegrationForkCount=4
Then, on that machine, that property will always be set already.