Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

versions:display-plugin-updates does not understand maven-enforcer-plugin

So, I'm trying to use the latest version of some plugins. Earlier I've used the prerequisites-tag but lots of resources (example) say that it should be considered deprecated and that the maven-enforcer-plugin should be used instead. this is my configuration:

<plugin>   <inherited>true</inherited>   <groupId>org.apache.maven.plugins</groupId>   <artifactId>maven-enforcer-plugin</artifactId>   <version>1.3.1</version>   <executions>     <execution>       <id>enforce-maven-3</id>       <goals>         <goal>enforce</goal>       </goals>       <configuration>         <rules>           <requireMavenVersion>             <version>3.0.4</version>           </requireMavenVersion>         </rules>         <fail>true</fail>       </configuration>     </execution>   </executions> </plugin> 

However, when I run mvn versions:display-plugin-updates I still get this text:

[ERROR] Project does not define required minimum version of Maven. [ERROR] Update the pom.xml to contain [ERROR]     <prerequisites> [ERROR]       <maven>3.0</maven> [ERROR]     </prerequisites> [INFO] [INFO] Require Maven 2.0.6 to use the following plugin updates: [INFO]   maven-jar-plugin ................................................ 2.4 [INFO]   maven-shade-plugin ............................................ 1.7.1 [INFO] [INFO] Require Maven 2.2.1 to use the following plugin updates: [INFO]   maven-jar-plugin ................................................ 2.6 [INFO] [INFO] Require Maven 3.0 to use the following plugin updates: [INFO]   maven-shade-plugin .............................................. 2.3 

Using the prerequisites-tag instead works.

like image 353
Richo Avatar asked Mar 30 '15 11:03

Richo


People also ask

What is the function of enforcer plugin in Maven?

The Enforcer plugin provides goals to control certain environmental constraints such as Maven version, JDK version and OS family along with many more built-in rules and user created rules.

What is org Apache Maven plugins?

org.apache.maven.plugins » maven-javadoc-pluginApache. The Apache Maven Javadoc Plugin is a plugin that uses the javadoc tool for generating javadocs for the specified project. Last Release on Aug 13, 2022.


1 Answers

It seems like this issue has been reported here (credits go to Aleksandr M for finding this).

Apparently, the display-dependency-updates goal relies on the prerequisites element to find out the Maven version required by the current project and totally ignores the enforcer-plugin, even though the prerequisites-tag should not be used normally, it is required in order to get the dependency plugin to behave as expected.

like image 138
Richo Avatar answered Oct 22 '22 04:10

Richo