Java 取消子项目中父项目的maven排除
我的Java 取消子项目中父项目的maven排除,java,maven,Java,Maven,我的pom中有以下内容 <dependencyManagement> <dependencies> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.7.13</version>
pom中有以下内容
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.13</version>
<!-- <scope>compile</scope>-->
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.13</version>
<!-- <scope>compile</scope>-->
</dependency>
此库似乎已排除在父项目中。有没有办法取消排除并将其包括在此项目中
编辑
我试着加上这个
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<goals>
<goal>
analyze-dep-mgt
</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
org.apache.maven.plugins
maven依赖插件
2.10
分析部门管理
真的
但我还是犯了同样的错误
编辑2
我可以用这个来工作
<properties>
<analyze.dependency.skip>true</analyze.dependency.skip>
</properties>
真的
但是,是否可以仅对我的依赖项进行跳过。您的父pom包含以下插件
org.apache.maven.plugins:maven-dependency-plugin:2.10:analyze-dep-mgt
这将检查依赖项中的一致性(您可以通过下载父pom进行查找)
再次声明插件并将
设置为true
以避免此检查
或者:如果您的父pom定义了一个可以设置为跳过执行的属性,请将此属性设置为false。在从后面的依赖项块(dependencyManagement之外的块)中删除版本标记后,是否可以尝试此操作。我尝试了此操作,但得到了相同的错误。这不是错误。这只是一个信息日志。还有第二个org.slf4j:slf4j-log4j12:jar被排除在DepMgt中。您能否共享DepMgt
pom.xml?如果我将其从依赖项列表中删除,它将成功构建。不确定,如果这不是问题的话。对不起,我没有访问父pom的权限。您可以下载父pom。否则就不可能构建您的项目。我尝试过这样做(在问题中选中edit),但我仍然得到相同的错误。可能您的配置被pluginManagement覆盖。尝试将您的配置添加到pluginManagement。我可以通过执行此true
成功完成此操作。但是,是否可以只跳过我的依赖项?我找不到用于该依赖项的参数。谢谢,如果您可以编辑您的答案,我将接受它作为此帖子的答案。
org.apache.maven.plugins:maven-dependency-plugin:2.10:analyze-dep-mgt