Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.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_Dependency Management_Transitive Dependency - Fatal编程技术网

从Maven pom中排除可传递依赖项

从Maven pom中排除可传递依赖项,maven,dependency-management,transitive-dependency,Maven,Dependency Management,Transitive Dependency,我添加了一个Maven依赖项,其中类型是testjar,范围是test。我想从中删除一个可传递的依赖项(因为在Nexus prod repo中缺少此依赖项,这会导致Jenkins构建失败)。我添加了一个排除标记,但仍然没有删除依赖项,即Jenkins build仍然失败并抱怨此依赖项。有什么线索吗 <dependency> <groupId>com.xxx</groupId> <artifactId>xxx&

我添加了一个Maven依赖项,其中类型是
testjar
,范围是
test
。我想从中删除一个可传递的依赖项(因为在Nexus prod repo中缺少此依赖项,这会导致Jenkins构建失败)。我添加了一个排除标记,但仍然没有删除依赖项,即Jenkins build仍然失败并抱怨此依赖项。有什么线索吗

    <dependency>
        <groupId>com.xxx</groupId>
        <artifactId>xxx</artifactId>
        <type>test-jar</type>
        <version>${xxx.version}</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <artifactId>jamon</artifactId>
                <groupId>com.jamonapi</groupId>
                <!-- <scope>compile</scope> -->
            </exclusion>
        </exclusions>
    </dependency>

com.xxx
xxx
试验罐
${xxx.version}
测验
火腿
com.jamonapi

您可以使用以下命令查找可传递依赖项的详细信息,然后可以排除依赖项:

mvn dependency:tree -Dverbose -Dincludes=<artifact_name>
mvn依赖项:树-Dverbose-Dincludes=

您可以使用以下命令查找可传递依赖项的详细信息,然后可以排除依赖项:

mvn dependency:tree -Dverbose -Dincludes=<artifact_name>
mvn依赖项:树-Dverbose-Dincludes=

您的意思是:
但依赖项仍然没有删除
?请提供POM的相关部分。可能其他依赖项通过传递性带来了此依赖项。如果没有pom文件,则无法说明更多内容。使用pom代码段编辑的问题我建议您使用命令:mvn dependency:tree-Dverbose-Dincludes=commons collections查看谁带来了可传递依赖项(请参见)您所说的:
是什么意思,但该依赖项仍然没有删除
?请提供相关部分可能是另一个依赖项通过传递性带来了这种依赖。如果没有pom文件,则无法说明更多信息。使用pom代码段编辑的问题我建议您使用命令:mvn dependency:tree-Dverbose-Dincludes=commons collections查看谁带来了可传递的依赖项(请参阅)