Подтвердить что ты не робот

Как показать версии плагина

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

4b9b3361

Ответ 1

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

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

Ответ 2

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

mvn help:effective-pom

Ответ 3

Я не знаю, что вы подразумеваете под "версией установленного плагина", но плагин справки 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

Ответ 4

Добавьте это в свой 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

Ответ 5

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