1

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?

phanin
  • 5,327
  • 5
  • 32
  • 50

1 Answers1

11

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>
Community
  • 1
  • 1
Marco Vargas
  • 1,232
  • 13
  • 31
  • Thanks for the reply. Unfortunately it does not show the version of maven-wagon plugin. – phanin May 04 '17 at 21:23
  • 1
    I just create a dummy project and you're right, but then the first option works for you: *mvn help:effective-pom* I just tried it by myself and it showed me the version 1.0, have you tried it? – Marco Vargas May 05 '17 at 16:58
  • Based on your feedback I went back to the answer and re-write it to show more options to get the info you need... hope it works for you phani – Marco Vargas May 05 '17 at 17:20
  • 1
    `mvn -Dplugin=org.codehaus.mojo:wagon-maven-plugin help:describe` worked. I don't think this plugin needs to be explicitly defined. That's why it didn't show up in effective pom. – phanin May 05 '17 at 18:43