Ale*_*der 6 dependency-management pom.xml maven
我有一个复杂的maven项目,有很多托管依赖项,跟踪这些依赖项的版本有一点问题.例如,spring库的版本由属性值{spring.version}引导 - 但我不知道这个属性来自哪个项目.
使用mvn依赖:树我可以看到所有版本都已解决的最终结果,但它没有深入细节告诉我获胜依赖版本的来源,以及为什么该版本是赢家.
PS版本号不是来自我的父pom.
Dan*_*iel 12
你可以试一试help:effective-pom
。只需确保将3.2.0
版本(或更高版本)与-Dverbose=true
标志集一起使用。这将打印出 POM 值的来源。
强制使用正确版本的插件:
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-help-plugin</artifactId>
<version>3.2.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Run Code Online (Sandbox Code Playgroud)
要使用它:
%> mvn help:effective-pom -Dverbose=true
Run Code Online (Sandbox Code Playgroud)
这将打印出以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- -->
<!-- Generated by Maven Help Plugin on 2019-07-24T15:28:33+02:00 -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/ -->
<!-- -->
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!-- -->
<!-- Effective POM for project -->
<!-- 'org.example:test-project:jar:0.0.1-SNAPSHOT' -->
<!-- -->
<!-- ====================================================================== -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <!-- org.example:test-project:0.0.1-SNAPSHOT, line 5 -->
<parent>
<groupId>org.springframework.boot</groupId> <!-- org.example:test-project:0.0.1-SNAPSHOT, line 16 -->
<artifactId>spring-boot-starter-parent</artifactId> <!-- org.example:test-project:0.0.1-SNAPSHOT, line 17 -->
<version>2.0.5.RELEASE</version> <!-- org.example:test-project:0.0.1-SNAPSHOT, line 18 -->
<relativePath /> <!-- org.example:test-project:0.0.1-SNAPSHOT, line 19 -->
</parent>
<groupId>org.example</groupId> <!-- org.example:test-project:0.0.1-SNAPSHOT, line 7 -->
<artifactId>test-project</artifactId> <!-- org.example:test-project:0.0.1-SNAPSHOT, line 8 -->
<version>0.0.1-SNAPSHOT</version> <!-- org.example:test-project:0.0.1-SNAPSHOT, line 9 -->
<name>Test Project</name> <!-- org.example:test-project:0.0.1-SNAPSHOT, line 12 -->
<description>Blabla.</description> <!-- org.example:test-project:0.0.1-SNAPSHOT, line 13 -->
<url>https://projects.spring.io/spring-boot/#/spring-boot-starter-parent/test-project</url> <!-- org.springframework.boot:spring-boot-starter-parent:2.0.5.RELEASE, line 14 -->
<licenses>
<license>
<name>Apache License, Version 2.0</name> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 12 -->
<url>http://www.apache.org/licenses/LICENSE-2.0</url> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 13 -->
</license>
</licenses>
<developers>
<developer>
<name>Pivotal</name> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 18 -->
<email>info@pivotal.io</email> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 19 -->
<organization>Pivotal Software, Inc.</organization> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 20 -->
<organizationUrl>http://www.spring.io</organizationUrl> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 21 -->
</developer>
</developers>
<properties>
<activemq.version>5.15.6</activemq.version> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 28 -->
<antlr2.version>2.7.7</antlr2.version> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 29 -->
<appengine-sdk.version>1.9.64</appengine-sdk.version> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 30 -->
<artemis.version>2.4.0</artemis.version> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 31 -->
<aspectj.version>1.8.13</aspectj.version> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 32 -->
...
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 208 -->
<artifactId>spring-boot</artifactId> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 209 -->
<version>2.0.5.RELEASE</version> <!-- org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE, line 210 -->
</dependency>
...
</dependencies>
</dependencyManagement>
</project>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
226 次 |
最近记录: |