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 942131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:13:25+00:00 2026-05-15T22:13:25+00:00

I have two projects, appA and appB, that each depend on a third project,

  • 0

I have two projects, “appA” and “appB”, that each depend on a third project, “common”. I’m in the process of moving them from ant to maven, but I’m having some difficulty figuring out the best way to do it in maven. My folder structure looks like this:

root
+ common  
+ appA  
+ appB  

I’ve been able to add a parent pom.xml to the root and have common, appA and appB as modules of this parent project to get appA and appB to build, but this is not what I want, a root pom.xml is not appropriate since appA and appB are completely unrelated projects.

I’d like appA and appB to be separate maven projects which both depend on the third common project and will build it if necessary, so that I can go into either the appA or appB folder and type “mvn package” to build appA + common or appB + common, respectively. This is how I have it set up in Ant but there may not be an appropriate parallel in maven. Any help or nudges in the right direction is greatly appreciated 🙂

  • 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-15T22:13:26+00:00Added an answer on May 15, 2026 at 10:13 pm

    (…) but this is not what I want, a root pom.xml is not appropriate since appA and appB are completely unrelated projects.

    Then don’t do it, don’t use aggregation if you don’t want to and just declare common as a dependency in the POM of appA and in the POM of appB. Something like this:

    <project>
      <modelVersion>4.0.0</modelVersion>
      <groupId>foo</groupId>
      <artifactId>appA</artifactId>
      <packaging>jar</packaging>
      <version>X-SNAPSHOT</version>
      ...
      <dependencies>
        <dependency>
          <groupId>bar</groupId><!-- at your discretion -->
          <artifactId>common</artifactId>
          <version>Y.Z-SNAPSHOT</version>
        </dependency>
        ...
      </dependencies>
      ...
    </project>
    

    Dependencies are resolved through the local repository so you’ll have to mvn install the common project first (and after any change to make them “visible”).

    During development, a common practice is to import dependent projects in your IDE and to configure them to depend on project inside the workspace (vs binary dependencies). This saves the install step to make changes visible. Most IDEs support this approach.

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

Sidebar

Ask A Question

Stats

  • Questions 460k
  • Answers 460k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer A webservice in IIS is hosted as an application owning… May 15, 2026 at 11:41 pm
  • Editorial Team
    Editorial Team added an answer If you are allowed to change the regular expression you… May 15, 2026 at 11:41 pm
  • Editorial Team
    Editorial Team added an answer You need to use the tag <include> . From the… May 15, 2026 at 11:41 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.