mavenmaven-3maven-wagon-plugin

How to find the version of a Maven plugin in the project?


I'm trying to find the version of maven-wagon plugin that's being used in my project. Is there a way to find the version of a used plugin via command line?


Solution

  • There are several ways to do this:

    1) Check the dependency tree:

    To find out the libraries and versions you are using you can use the Maven dependency tree, just execute this where you have your project (pom.xml):

    mvn dependency:tree -Dverbose
    

    This is useful detect which version of an specific library your project is using, but I think it doesn't include plugins.

    2) Describe the specific plugin:

    If you want to know what version of an specific plugin you have installed you can do this:

    mvn -Dplugin=: help:describe

    mvn -Dplugin=org.codehaus.mojo:wagon-maven-plugin help:describe

    This shows you something like this:

    Name: Maven Wagon plugin
    Description: Maven plugin that can be used to access various operations on a
      given URL using a supported maven wagon. Supports recursive upload, download,
      and list directory content functionality.
    Group Id: org.codehaus.mojo
    Artifact Id: wagon-maven-plugin
    Version: 1.0
    Goal Prefix: wagon
     
    This plugin has 11 goals:
    ...
    ...
    

    3) Check the effective pom:

    Execute this:

    mvn help:effective-pom

    and go through the pom looking for the plugin you need to clarify, there you will find something like this:

    <plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>wagon-maven-plugin</artifactId>
       <version>1.0</version>
    </plugin>