How to change maven surefire default plugin for higher version?

Now I run Maven 3.0.3 and use maven-surefire-plugin:2.7.2 , but I want Maven to use a higher version of maven-surefire-plugin ...

+4
source share
2 answers

The best way to declare plugin versions is to use pluginManagement:

 <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.18.1</version> </plugin> ... </plugins> <pluginManagement> </build> 

In addition, it is best to declare all plugins and their corresponding version through pluginManagement in the parent pump (usually this is pom).

+7
source

Just declare the desired version in POM, where you specify the surefire plugin.

As I recall, Maven 3 will really complain if you do not explicitly specify the desired version for each plugin.

eg:

 <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>XXX</version> </plugin> 
+2
source

All Articles