Как показать версии плагинов - PullRequest
24 голосов
/ 20 апреля 2011

Я хочу знать версию установленного плагина.Какая команда может это сделать?

Ответы [ 5 ]

19 голосов
/ 20 апреля 2011
mvn -Dplugin=<groupId>:<artifactId> help:describe

подробное описание плагина - включая версию

13 голосов
/ 20 апреля 2011

Если вы хотите узнать, какую версию плагинов (включая плагины, предоставляемые через maven master pom) использует ваша сборка, попробуйте:

mvn help:effective-pom
7 голосов
/ 20 апреля 2011

Я не знаю, что вы подразумеваете под 'версией плагина установлена ​​', но Справочный плагин Maven позволяет получить описание плагина, указав groupId и artifactId

mvn -Dplugin=<groupId>:<artifactId> help:describe

Вы получите подробное описание плагина - включая версию (хотя я должен признать, что не знаю стратегии разрешения номера версии).

Пример для подключаемого модуля maven-dependency-plugin

mvn -Dplugin=org.apache.maven.plugins:maven-dependency-plugin help:describe

выход

Name: Maven Dependency Plugin
Description: Provides utility goals to work with dependencies like copying,
  unpacking, analyzing, resolving and many more.
Group Id: org.apache.maven.plugins
Artifact Id: maven-dependency-plugin
Version: 2.2
Goal Prefix: dependency

This plugin has 21 goals:

dependency:analyze
  Description: Analyzes the dependencies of this project and determines which
    are: used and declared; used and undeclared; unused and declared. This goal
    is intended to be used standalone, thus it always executes the test-compile
    phase - use the dependency:analyze-only goal instead when participating in
    the build lifecycle.

dependency:analyze-dep-mgt
  Description: This mojo looks at the dependencies after final resolution and
    looks for mismatches in your dependencyManagement section. In versions of
    maven prior to 2.0.6, it was possible to inherit versions that didn't match
    your dependencyManagement. See MNG-1577 for more info. This mojo is also
    useful for just detecting projects that override the dependencyManagement
    directly. Set ignoreDirect to false to detect these otherwise normal
    conditions.

dependency:analyze-duplicate
  Description: Analyzes the <dependencies/> and <dependencyManagement/> tags
    in the pom.xml and determines the duplicate declared dependencies.

... and much more
1 голос
/ 17 июня 2014

Добавьте это в ваш файл pom.xml, и вы получите результат на mvn clean install:

<plugins>
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>versions-maven-plugin</artifactId>
    <version>2.1</version>
    <executions>
      <execution>
        <phase>validate</phase>
        <goals>
           <goal>display-dependency-updates</goal>
           <goal>display-plugin-updates</goal>
           <goal>display-property-updates</goal>
        </goals>
      </execution>
    </executions>
  </plugin>
</plugins>

Если вы просто хотите сделать это один раз:

mvn versions:display-plugin-updates
0 голосов
/ 10 декабря 2018

Вы можете добавить параметр "-X" при упаковке maven (mvn clean compile * -X), а затем выполнить поиск "artifactId", чтобы увидеть точный номер версии.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...