Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在maven pom中是否有跟踪属性来源的方法?_Maven_Pom.xml_Dependency Management - Fatal编程技术网

在maven pom中是否有跟踪属性来源的方法?

在maven pom中是否有跟踪属性来源的方法?,maven,pom.xml,dependency-management,Maven,Pom.xml,Dependency Management,我有一个复杂的maven项目,有很多托管依赖项,在跟踪这些依赖项的版本时有点问题。例如,spring库的版本是由属性值{spring.version}引导的,但我不知道这个属性来自哪个项目 使用mvn dependency:tree,我可以看到解决所有版本的最终结果,但它没有深入详细地告诉我获胜的依赖版本来自哪里,以及为什么该版本是赢家 p.S.版本号不是来自我的父母pom。你可以给帮助:有效的pom一次尝试。只需确保将3.2.0版本(或更高版本)与-Dverbose=true标志集一起使用即可

我有一个复杂的maven项目,有很多托管依赖项,在跟踪这些依赖项的版本时有点问题。例如,spring库的版本是由属性值{spring.version}引导的,但我不知道这个属性来自哪个项目

使用mvn dependency:tree,我可以看到解决所有版本的最终结果,但它没有深入详细地告诉我获胜的依赖版本来自哪里,以及为什么该版本是赢家


p.S.版本号不是来自我的父母pom。

你可以给
帮助:有效的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>
这将打印出以下内容:

<?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>

4.0.0  
org.springframework.boot
spring启动程序父级
2.0.5.1发布
org.example
测试项目
0.0.1-快照
测试项目
布拉布拉。
https://projects.spring.io/spring-boot/#/spring-启动启动程序父/测试项目
Apache许可证,版本2.0
http://www.apache.org/licenses/LICENSE-2.0  
关键的
info@pivotal.io  
Pivotal软件公司。
http://www.spring.io  
5.15.6  
2.7.7  
1.9.64  
2.4.0  
1.8.13  
...
org.springframework.boot
弹簧靴
2.0.5.1发布
...

这就是您要寻找的:
mvn依赖项:列出存储库
?@Adonis实际上不是。这将告诉我使用了什么,但没有告诉我为什么。为什么总是一个大问题(正如您的大写字母所强调的),到目前为止,我无法告诉您如何通过mavenwork像一个符咒一样找出某些依赖项在某个版本中使用的原因!
<?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>