How to change default maven surefire plugin to higher version?
Asked Answered
C

2

10

Now I'm running Maven 3.0.3 and it uses maven-surefire-plugin:2.7.2, but I want Maven to use a higher version of maven-surefire-plugin

Canakin answered 12/3, 2013 at 11:5 Comment(1)
Why not running maven 3.0.4 or 3.0.5 ?Uncivil
U
19

The better way to declare versions of plugins is to use pluginManagement:

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

Furthermore, it's best practice to declare all plugins and their appropriate version via pluginManagement in a parent pom (usually a company pom).

Uncivil answered 12/3, 2013 at 17:49 Comment(0)
A
2

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

As I recall, Maven 3 will actually complain if you don't explicitly specify the desired version for each plugin.

E.g:

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>X.X.X</version>
</plugin>
Alsace answered 12/3, 2013 at 11:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.