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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:03:49+00:00 2026-05-15T17:03:49+00:00

Trying to create a multi module maven project in eclipse. Parent Pom.xml <project xmlns=http://maven.apache.org/POM/4.0.0

  • 0

Trying to create a multi module maven project in eclipse.

Parent Pom.xml

<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>parent</groupId>
  <artifactId>proj1</artifactId>
  <version>${myversion}</version>
  <packaging>pom</packaging>
  <properties>
   <myversion>1.0.0</myversion>
  </properties>
  <modules>
   <module>child1</module>
   <module>child2</module>
  </modules>
</project>

Child-Module 1 Pom.xml

<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>
  <parent>
    <artifactId>proj1</artifactId>
    <groupId>parent</groupId>
    <version>${myversion}</version>
  </parent>
  <groupId>parent</groupId>
  <artifactId>child1</artifactId>
  <version>${myversion}</version>
</project>

Child Module 2 Pom.xml

<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>
  <parent>
    <artifactId>proj1</artifactId>
    <groupId>parent</groupId>
    <version>${myversion}</version>
  </parent>
  <groupId>parent</groupId>
  <artifactId>child2</artifactId>
  <version>${myversion}</version>
  <dependencies>
   <dependency>
    <groupId>parent</groupId>
    <artifactId>child1</artifactId>
    <version>${myversion}</version>
    <type>jar</type>
    <scope>compile</scope>
   </dependency>
  </dependencies>
</project>

If I use mvn clean install on command line from the parent folder I can build find. All the projects are build successfully.

But in eclipse I keep getting an error for Child Module 2 pom.xml

Description Resource Path Location Type
parent:child1:1.0.0:jar Missing:
----------
1) parent:proj1:pom:${myversion}
----------
1 required artifact is missing.

for artifact: 
  parent:proj1:pom:${myversion}

from the specified remote repositories:
  central (http://repo1.maven.org/maven2, releases=true, snapshots=false)
 pom.xml /child2 line 1 Maven Problem

I need to achieve 2 things
1. have a maven property define the version in the parent pom file.
2. use this property to define the version in all the child modules.

What should I do? I am stuck. Please help.

I am using Eclipse Galileo with m2Eclipse

  • 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-15T17:03:50+00:00Added an answer on May 15, 2026 at 5:03 pm

    This can’t work, you can’t get the version of the parent to use from the parent (and actually, properties don’t get substituted in the parent element, see MNG-624). So you need to hard code the version and your parent POM should be:

    <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>parent</groupId>
      <artifactId>proj1</artifactId>
      <version>1.0.0</version>
      <packaging>pom</packaging>
      <modules>
       <module>child1</module>
       <module>child2</module>
      </modules>
    </project>
    

    And in your child POM 1. you need to hardcode the version in /project/parent/version 2. you don’t need to specify the <version> (you inherit it) 3. use the ${project.version} property in dependencies.

    <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>
      <parent>
        <artifactId>proj1</artifactId>
        <groupId>parent</groupId>
        <version>1.0.0</version>
      </parent>
      <groupId>parent</groupId>
      <artifactId>child2</artifactId>
      <!--version>${myversion}</version--> <!-- Inherited -->
      <dependencies>
       <dependency>
        <groupId>parent</groupId>
        <artifactId>child1</artifactId>
        <version>${project.version}</version> <!-- use the built-in property here -->
        <!--type>jar</type--> <!-- This is a default, you can omit it -->
        <!--scope>compile</scope--> <!-- This is a default, you can omit it -->
       </dependency>
      </dependencies>
    </project>
    

    Versionless parent elements will be supported in Maven 3.1.

    See also

    • Missing artifact error in Maven
    • Eliminate Maven POM Redundancy
    • Maven 3 – Worth it???
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.