The project contains another dependency with the same archive name

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.

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.

Duplicate bouncycastle dependencies

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.

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

Deployment assembly settings

Also make sure you don't have bcmail-jdk14-1.38.jar in your 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).


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

<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