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

  • Home
  • SEARCH
  • 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 1052355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:04:48+00:00 2026-05-16T17:04:48+00:00

I have a parent project with 5 children having also dependencies between each other.

  • 0

I have a parent project with 5 children having also dependencies between each other. I used both inheritence with <parent> element in the children pom.xml and aggregation with <module> element in the parent.

My parent pom looks like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.domain</groupId>
<artifactId>Parent</artifactId>
<packaging>pom</packaging>
<version>RELEASE</version>
<name>Parent</name>

<modules>
    <module>../Child1</module>
    <module>../Child2</module>
    <module>../Child3</module>
    <module>../Child4</module>
    <module>../Child5</module>
</modules>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.domain</groupId>
            <artifactId>Child1</artifactId>
            <version>RELEASE</version>
        </dependency>
        <dependency>
            <groupId>com.domain</groupId>
            <artifactId>Child2</artifactId>
            <version>RELEASE</version>
        </dependency>
    </dependencies>
</dependencyManagement>
</project>

Child3 pom looks like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.domain</groupId>
<artifactId>Child3</artifactId>
<name>Child3</name>
<packaging>war</packaging>

<parent>
    <artifactId>Parent</artifactId>
    <groupId>com.domain</groupId>
    <version>RELEASE</version>
</parent>

<dependencies>
    <dependency>
        <groupId>com.domain</groupId>
        <artifactId>Child1</artifactId>
    </dependency>
    <dependency>
        <groupId>com.domain</groupId>
        <artifactId>Child2</artifactId>
    </dependency>
</dependencies>
</project>

Everything works fine when I run mvn install on Parent or Child1. But when I run it on Child3 I get the following errors:

[INFO] Failed to resolve artifact.
Missing:
----------
1) com.domain:Child1:jar:RELEASE
...
2) com.domain:Child2:jar:RELEASE

What’s wrong with my set-up?

  • 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-16T17:04:49+00:00Added an answer on May 16, 2026 at 5:04 pm

    I won’t really try to solve the issue of your current approach but will rather cover what I consider as the best practice in this case. Feel free to adopt it or not 🙂

    First of all, please note that the RELEASE (and LATEST) is a special keyword (not sure you are aware of this) and RELEASE is somehow misused here (a parent with a version defined to RELEASE doesn’t really make sense). Anyway, these special keywords were a bad idea and are deprecated (I’m not sure they’re supported in Maven3) for the sake of build reproducibility, just avoid using them.

    So, use a SNAPSHOT version if the project is under active development instead i.e. modify the parent like this:

    <project>
    
      <modelVersion>4.0.0</modelVersion>
    
      <groupId>com.domain</groupId>
      <artifactId>Parent</artifactId>
      <version>1.0-SNAPSHOT</version>
      <packaging>pom</packaging>
    
      <name>Parent</name>
    
      <modules>
        <module>../Child1</module>
        <module>../Child2</module>
        <module>../Child3</module>
        <module>../Child4</module>
        <module>../Child5</module>
      </modules>
    
    </project>
    

    Note that I removed the dependencyManagement element, I don’t think it provides much added value for internal dependencies of a multi module build and recommend using the the ${project.groupId} and ${project.version} built-in properties instead when declaring them:

    <project>
      <modelVersion>4.0.0</modelVersion>
    
      <parent>
        <artifactId>Parent</artifactId>
        <groupId>com.domain</groupId>
        <version>1.0-SNAPSHOT</version><!-- must hard code this -->
      </parent>
    
      <!--groupId>com.domain</groupId--><!-- you can skip this, you inherit it -->
      <artifactId>Child3</artifactId>
      <packaging>war</packaging>
    
      <name>Child3</name>
    
      <dependencies>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>Child1</artifactId>
          <version>${project.version}</version>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>Child2</artifactId>
          <version>${project.version}</version>
        </dependency>
      </dependencies>
    </project>
    

    As I wrote, I don’t think using dependencyManagement is really useful for internal dependencies and that’s how I setup my projects. But you can if you want. Just use the properties to not repeat information.

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

Sidebar

Related Questions

We have a sub-project 'commonUtils' that has many generic code-snippets used across the parent
Currently, I have a Maven project which inherits from a parent pom defining two
I have a project with a parent pom.xml which define profiles, and a debug
I have all these version numbers throughout parent pom and children poms including the
Maven requires a parent project to have <packaging>pom</packaging> clause in the parent's pom.xml. When
I have a parent project that is branched to many dependent child projects. I
I have a Maven multi-module project and I need two different parent POMs in
If you have Parent has_many :children Child Is there any reason a foreign key
I have a parent component, say P, which has function, say Pfunc. I also
I have a multi module project with a parent project A, and two childs

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.