Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6784717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:01:52+00:00 2026-05-26T17:01:52+00:00

When building the project with Maven I get 2 jars in my target dir:

  • 0

When building the project with Maven I get 2 jars in my target dir:
aopalliance-aopalliance-1.0.jar
org.aopalliance-aopalliance-1.0.jar

I suspect the following dependency in my pom.xml is the one responsible

<dependency>
    <groupId>org.aopalliance</groupId>
    <artifactId>aopalliance</artifactId>
    <version>1.0</version>
</dependency>

but I don’t understand why this happens. I have a bunch of other dependencies in my pom.xml that are defined in the same way, and the JAR in question is installed in the Nexus just like the other JAR’s, but the other dependencies do not result in JAR’s in my target dir.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:01:52+00:00Added an answer on May 26, 2026 at 5:01 pm

    In the light of this answer, it is assumed you use some kind of plugin like the Maven Assembly plugin or Maven EAR plugin to copy all the project’s dependencies to your target folder.

    It is highly likely that some dependency like Guice is pulling in the aopalliance:aopalliance artifact (groupId:artifactId notation), whereas you just added a dependency on org.aopalliance:aopalliance. Maven doesn’t know that it just added the same class files twice – it checks the groupId and artifactId to see whether two jars are (supposedly) different.

    You have two options:

    1. Remove the dependency in your poms, or change the groupId to aopalliance.

    2. Trace where the aopalliance dependency is coming from, then exclude the aopalliance artifact from the problematic artifacts’ transitive dependencies.

    You can do (2) by running mvn dependency:tree, or with the M2Eclipse plugin by opening your POM and looking at the Dependency Hierarchy tab. Here’s some sample output of the dependency:tree command:

    mygroup:earproj:pom:2.3.1-SNAPSHOT
    +- mygroup:wslib:jar:2.3.1-SNAPSHOT:compile
    |  +- axis:axis:jar:1.4:compile
    |  |  +- org.apache.axis:axis-saaj:jar:1.4:compile
    |  |  +- axis:axis-wsdl4j:jar:1.5.1:runtime
    |  |  +- commons-logging:commons-logging:jar:1.0.4:runtime
    |  |  \- commons-discovery:commons-discovery:jar:0.2:runtime
    |  +- org.apache.axis:axis-jaxrpc:jar:1.4-noqname:compile
    |  \- commons-httpclient:commons-httpclient:jar:3.0.1:runtime
    |     \- commons-codec:commons-codec:jar:1.2:runtime
    +- mygroup:commonclass:2.3.1-SNAPSHOT:compile
    

    Take a look at commons-logging for example, we can see that the axis:axis library depends on it.

    Once you know which library depends on aopalliance, you can add an exclusion in the POM. It would be preferred if you keep this exclusion and the declaration of the org.aopalliance dependency in the same POM.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a project using Maven. In the Pom.xml i have added dependency
I have the following in my pom: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ant-plugin</artifactId> <version>2.3</version> <configuration> <target> <echo
I'm building an executable jar for a maven java project I have. It works
I am having problem building my project (using maven 2) which references some jars
I'm building my project with maven so according to maven way, config should be
I am building a project using Visual Studio. The project has a dependency on
I'm using Spring 2.5.6 and building my project with Maven 2.2.1. We use PropertyPlaceholderConfigurer
I have a Java project I am building with Maven. I am now trying
I am building my project using maven and eclipse. I am using the command
I have a maven project where I am building a war file, but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.