该项目包含另一个具有相同存档名称的依赖项。

时间:2021-11-05 10:43:21

I'm seeing the following error (and a couple of others like it) in my markers:

在我的标记中,我看到了以下错误(以及其他一些类似的错误):

Invalid classpath publish/export dependency C:/Users/LevineJ/.m2/repository/org/bouncycastle/bcmail-jdk14/1.38/bcmail-jdk14-1.38.jar.
The project contains another dependency with the same archive name.

When I do a quick search, I find bcmail-jdk14.1.jar in two locations:

当我快速搜索时,我发现bcmail-jdk14.1。jar在两个位置:

  • C:\Users\LevineJ.m2\repository\bouncycastle\bcmail-jdk14\138
  • C:\Users\LevineJ.m2\repository\ bouncycastle \ bcmail-jdk14 \ 138
  • C:\Users\LevineJ.m2\repository\org\bouncycastle\bcmail-jdk14\1.38
  • C:\Users\LevineJ.m2\repository\org\ bouncycastle \ bcmail-jdk14 \ 1.38

From what I've read on the topic (various posts/articles), I'm thinking this has to do with the error I'm seeing. Can someone please provide some info regarding: 1. What does this error mean? 2. How would I go about solving it?

从我所读到的主题(各种文章/文章)中,我认为这与我所看到的错误有关。请提供一些关于:1的信息。这个错误是什么意思?2。我该如何解决它呢?

If it helps, I'm using:

如果有用的话,我用:

  • Eclipse Java EE - Luna Service Release 1 (4.4.1)
  • Eclipse Java EE - Luna服务发布1 (4.4.1)
  • m2e plugin
  • m2e的插件
  • m2e-wtp plugin
  • m2e-wtp插件

Results of mvn dependency:tree

结果mvn依赖性:树

C:\Users\LevineJ\Development\default-workspace\adweb>mvn dependency:tree
Picked up _JAVA_OPTIONS: -Dcom.gxs.common.configuration.proxy.envid=totcpa -Dcom.gxs.common.logging.configfilepath=C:\Users\LevineJ\Development\config\adweb\LogCfg.xml -Dcom.gxs.common.configuration.localenvid=adweb -Dcom.gxs.common.logging.sdklogfile=C:\Users\LevineJ\Development\config\adweb\tgo.log -Dcom.gxs.common.configuration.path=C:\Users\LevineJ\Development\config\adweb\CRC
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.gxs:adweb:war:${build.number}
[WARNING] 'version' contains an expression but should be a constant. @ line 9, column 11
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:tomcat-maven-plugin is missing. @ line 325, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building adweb ${build.number}
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.gxs:reportservice-client:jar:05.09.00.16 is missing, no dependency information available
[INFO]
[INFO] --- maven-dependency-plugin:2.3:tree (default-cli) @ adweb ---
[WARNING] Missing POM for com.gxs:reportservice-client:jar:05.09.00.16
[INFO] com.gxs:adweb:war:${build.number}
[INFO] +- com.opentext.ix.ad:adcommon:jar:LATEST:compile
[INFO] |  +- com.gxs.imclient:IMclient:jar:07.24.00.03:compile
[INFO] |  +- com.gxs.e2eui:wscommon:jar:1.0:compile
[INFO] |  |  +- org.apache.woden:woden-impl-dom:jar:1.0M8:compile
[INFO] |  |  |  +- org.apache.woden:woden-api:jar:1.0M8:compile
[INFO] |  |  |  +- org.apache.ws.commons.schema:XmlSchema:jar:1.4.2:compile
[INFO] |  |  |  +- org.apache.ant:ant:jar:1.7.0:compile
[INFO] |  |  |  +- wsdl4j:wsdl4j:jar:1.6.2:compile
[INFO] |  |  |  +- xerces:xercesImpl:jar:2.8.1:compile
[INFO] |  |  |  +- xerces:xmlParserAPIs:jar:2.6.0:compile
[INFO] |  |  |  \- org.apache.ws.commons.axiom:axiom-api:jar:1.2.7:compile
[INFO] |  |  |     +- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.1:compile
[INFO] |  |  |     +- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.2:compile
[INFO] |  |  |     \- jaxen:jaxen:jar:1.1.1:compile
[INFO] |  |  \- xml-apis:xml-apis:jar:1.3.04:compile
[INFO] |  +- com.gxs.e2eui:imqsclient:jar:1.0:compile
[INFO] |  |  \- org.apache.axis2:axis2-jws-api:jar:1.4.1:compile
[INFO] |  |     +- org.apache.ant:ant-launcher:jar:1.7.0:compile
[INFO] |  |     +- org.apache.ws.commons.axiom:axiom-impl:jar:1.2.7:compile
[INFO] |  |     +- org.apache.ws.commons.axiom:axiom-dom:jar:1.2.7:compile
[INFO] |  |     +- javax.mail:mail:jar:1.4.2:compile
[INFO] |  |     |  \- javax.activation:activation:jar:1.1:compile
[INFO] |  |     +- xalan:xalan:jar:2.7.0:compile
[INFO] |  |     +- org.codehaus.woodstox:wstx-asl:jar:3.2.4:compile
[INFO] |  |     \- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
[INFO] |  +- com.gxs:reportservice-client:jar:05.09.00.16:compile
[INFO] |  +- org.springframework.data:spring-data-commons-core:jar:1.4.1.RELEASE:compile
[INFO] |  +- org.springframework.ws:spring-oxm:jar:1.5.10:compile
[INFO] |  |  +- org.springframework.ws:spring-xml:jar:1.5.10:compile
[INFO] |  |  \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] |  +- org.springframework:spring-context:jar:3.1.2.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-aop:jar:3.1.2.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-expression:jar:3.1.2.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-asm:jar:3.1.2.RELEASE:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.2:compile
[INFO] |  +- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.3.2:compile
[INFO] |  +- org.springframework:spring-core:jar:3.1.2.RELEASE:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.3.3:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.3.2:compile
[INFO] |  |  \- commons-codec:commons-codec:jar:1.6:compile
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.7.5:runtime
[INFO] |  +- org.slf4j:slf4j-log4j12:jar:1.7.5:runtime
[INFO] |  \- com.thoughtworks.xstream:xstream:jar:1.2.2:compile
[INFO] |     \- xpp3:xpp3_min:jar:1.1.3.4.O:compile
[INFO] +- org.jboss.spec:jboss-javaee-6.0:pom:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.resource:jboss-connector-api_1.5_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar:1.0.0.Final:provided
[INFO] |  |  \- javax.xml:jaxrpc-api:jar:1.1:provided
[INFO] |  |     \- javax.xml.soap:saaj-api:jar:1.3:provided
[INFO] |  +- org.jboss.spec.javax.el:jboss-el-api_2.2_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.enterprise.deploy:jboss-jad-api_1.2_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.security.auth.message:jboss-jaspi-api_1.0_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.xml.registry:jboss-jaxr-api_1.0_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.jms:jboss-jms-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.servlet.jsp:jboss-jsp-api_2.2_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.xml.rpc:jboss-jaxrpc-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.xml.soap:jboss-saaj-api_1.3_spec:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.spec.javax.xml.ws:jboss-jaxws-api_2.2_spec:jar:1.0.0.Final:provided
[INFO] |  +- javax.enterprise:cdi-api:jar:1.0-SP4:provided
[INFO] |  +- javax.jws:jsr181-api:jar:1.0-MR1:provided
[INFO] |  +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:provided
[INFO] |  +- org.jboss.resteasy:jaxrs-api:jar:2.1.0.GA:provided
[INFO] |  +- stax:stax-api:jar:1.0.1:provided
[INFO] |  \- javax.validation:validation-api:jar:1.0.0.GA:provided
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.3.2:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.3.2:compile
[INFO] +- com.sun.faces:jsf-api:jar:LATEST:compile
[INFO] +- com.sun.faces:jsf-impl:jar:LATEST:compile
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.3.1:compile
[INFO] +- commons-io:commons-io:jar:2.4:compile
[INFO] +- org.primefaces:primefaces:jar:4.0:compile
[INFO] +- org.primefaces.extensions:primefaces-extensions:jar:2.0.0:compile
[INFO] |  \- com.google.code.gson:gson:jar:2.2.4:compile
[INFO] +- org.primefaces.themes:all-themes:jar:LATEST:compile
[INFO] +- javax.inject:javax.inject:jar:1.0-PFD-1:compile
[INFO] +- org.springframework:spring-web:jar:3.1.2.RELEASE:compile
[INFO] |  +- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  \- org.springframework:spring-beans:jar:3.1.2.RELEASE:compile
[INFO] +- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- log4j:log4j:jar:1.2.15:compile
[INFO] +- xstream:xstream:jar:1.1.2:compile
[INFO] +- junit:junit:jar:4.11:compile
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- org.mockito:mockito-all:jar:1.8.5:test
[INFO] +- org.springframework:spring-test:jar:3.1.2.RELEASE:compile
[INFO] +- org.glassfish.web:el-impl:jar:2.2:compile
[INFO] |  \- javax.el:el-api:jar:2.2:compile
[INFO] +- com.lowagie:itext:jar:2.1.7:compile
[INFO] |  +- bouncycastle:bcmail-jdk14:jar:138:compile
[INFO] |  +- bouncycastle:bcprov-jdk14:jar:138:compile
[INFO] |  \- org.bouncycastle:bctsp-jdk14:jar:1.38:compile
[INFO] |     +- org.bouncycastle:bcprov-jdk14:jar:1.38:compile
[INFO] |     \- org.bouncycastle:bcmail-jdk14:jar:1.38:compile
[INFO] +- com.gxs:primefaces-theme-tgo:jar:01.00.00.01:compile
[INFO] +- com.gxs:crc-client:jar:2.0.11:compile
[INFO] +- com.gxs:crc-system:jar:2.0.11:compile
[INFO] +- com.gxs.tglogging:tglogging:jar:05.09.00.02:compile
[INFO] +- com.gxs.fms:FMSClient:jar:LATEST:compile
[INFO] \- com.opentext:metrics-service-dto:jar:LATEST:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.374 s
[INFO] Finished at: 2014-11-14T11:26:44-05:00
[INFO] Final Memory: 12M/306M
[INFO] ------------------------------------------------------------------------

Screenshot of Maven Dependencies/Build Path 该项目包含另一个具有相同存档名称的依赖项。

Maven依赖/构建路径的屏幕截图。

Screenshot of Deployment Assembly 该项目包含另一个具有相同存档名称的依赖项。 Thanks.

部署程序集的屏幕截图谢谢。

3 个解决方案

#1


9  

The issue is that runtime *.jar dependencies are published into WEB-APP/lib folder. If two dependencies have the same name, they can not be published.

问题是运行时*。jar依赖关系被发布到web应用程序/lib文件夹中。如果两个依赖项有相同的名称,它们就不能被发布。

The strange thing with your issue is that itext (with its bouncycastle dependencies) are pretty common. Several projects in our company have it, but I have never seen a similar warning.

您的问题的奇怪之处在于itext(具有bouncycastle依赖性)非常常见。我们公司的几个项目都有,但我从未见过类似的警告。

该项目包含另一个具有相同存档名称的依赖项。

So this makes me wonder, where the issue comes from. The two duplicate dependencies (bcmail and bcprov) are actually not duplicate - they have different version (hence different JAR name). So the issue must be somewhere else.

这让我很好奇,这个问题是怎么来的。两个重复的依赖项(bcmail和bcprov)实际上不是重复的——它们有不同的版本(因此有不同的JAR名称)。所以问题肯定在别处。

Please check your Java Build Path (or check .classpath project file) settings and Deployment Assembly settings. You must have unintentionally included bcmail duplicate manually.

请检查您的Java构建路径(或检查.classpath项目文件)设置和部署程序集设置。您必须手动地包含bcmail副本。

该项目包含另一个具有相同存档名称的依赖项。

Also make sure you don't have bcmail-jdk14-1.38.jar in your src/main/webapp/WEB-INF/lib/.

还要确保没有bcmail-jdk14-1.38。jar在src / main / webapp / web - inf / lib /。

And last possible suspect might be some unconventional JBoss deployment configuration combining two projects into one web application. But I am not that familiar with JBoss Tools (just guessing you are using it based on your dependencies).

最后一个可能的疑点可能是一些非传统的JBoss部署配置,将两个项目合并到一个web应用程序中。但是我并不熟悉JBoss工具(只是猜测您是基于您的依赖项使用它)。

#2


1  

I've checked all answers above but they don't work for me. I found that my Maven project has a different directory than regular Java Web project. I checked file .classpath in root directory and I changed

我已经检查了所有的答案,但它们对我不起作用。我发现我的Maven项目与普通的Java Web项目有一个不同的目录。我检查了根目录中的文件.classpath,然后我改变了。

<attributes>
        <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>

to

<attributes>
        <attribute name="org.eclipse.jst.component.dependency" value="**WebRoot**/WEB-INF/lib"/>
</attributes>

which solved my problem

这解决了我的问题

#3


1  

I was getting this issue because I was having following configuration

我得到这个问题是因为我有下面的配置。

           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping>
                </configuration>
            </plugin>

When I added @version@ to outputFileNameMapping, it resolved this error.

当我添加@version@来outputfilemapping时,它解决了这个错误。

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <outputFileNameMapping>@{artifactId}@.@{extension}@.@{version}@</outputFileNameMapping>
                </configuration>
            </plugin>

#1


9  

The issue is that runtime *.jar dependencies are published into WEB-APP/lib folder. If two dependencies have the same name, they can not be published.

问题是运行时*。jar依赖关系被发布到web应用程序/lib文件夹中。如果两个依赖项有相同的名称,它们就不能被发布。

The strange thing with your issue is that itext (with its bouncycastle dependencies) are pretty common. Several projects in our company have it, but I have never seen a similar warning.

您的问题的奇怪之处在于itext(具有bouncycastle依赖性)非常常见。我们公司的几个项目都有,但我从未见过类似的警告。

该项目包含另一个具有相同存档名称的依赖项。

So this makes me wonder, where the issue comes from. The two duplicate dependencies (bcmail and bcprov) are actually not duplicate - they have different version (hence different JAR name). So the issue must be somewhere else.

这让我很好奇,这个问题是怎么来的。两个重复的依赖项(bcmail和bcprov)实际上不是重复的——它们有不同的版本(因此有不同的JAR名称)。所以问题肯定在别处。

Please check your Java Build Path (or check .classpath project file) settings and Deployment Assembly settings. You must have unintentionally included bcmail duplicate manually.

请检查您的Java构建路径(或检查.classpath项目文件)设置和部署程序集设置。您必须手动地包含bcmail副本。

该项目包含另一个具有相同存档名称的依赖项。

Also make sure you don't have bcmail-jdk14-1.38.jar in your src/main/webapp/WEB-INF/lib/.

还要确保没有bcmail-jdk14-1.38。jar在src / main / webapp / web - inf / lib /。

And last possible suspect might be some unconventional JBoss deployment configuration combining two projects into one web application. But I am not that familiar with JBoss Tools (just guessing you are using it based on your dependencies).

最后一个可能的疑点可能是一些非传统的JBoss部署配置,将两个项目合并到一个web应用程序中。但是我并不熟悉JBoss工具(只是猜测您是基于您的依赖项使用它)。

#2


1  

I've checked all answers above but they don't work for me. I found that my Maven project has a different directory than regular Java Web project. I checked file .classpath in root directory and I changed

我已经检查了所有的答案,但它们对我不起作用。我发现我的Maven项目与普通的Java Web项目有一个不同的目录。我检查了根目录中的文件.classpath,然后我改变了。

<attributes>
        <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>

to

<attributes>
        <attribute name="org.eclipse.jst.component.dependency" value="**WebRoot**/WEB-INF/lib"/>
</attributes>

which solved my problem

这解决了我的问题

#3


1  

I was getting this issue because I was having following configuration

我得到这个问题是因为我有下面的配置。

           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping>
                </configuration>
            </plugin>

When I added @version@ to outputFileNameMapping, it resolved this error.

当我添加@version@来outputfilemapping时,它解决了这个错误。

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <outputFileNameMapping>@{artifactId}@.@{extension}@.@{version}@</outputFileNameMapping>
                </configuration>
            </plugin>