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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:46:52+00:00 2026-06-13T06:46:52+00:00

I have a maven project Parent Project (with the following modules) (package type pom)

  • 0

I have a maven project

  • Parent Project (with the following modules) (package type pom)
    • API Project (package type jar)
    • Packaging Project (has a dependency on API Project) (package type custom)

I want to be able to deploy the API project to Nexus repositories so others can leverage that code. The Packaging Project is more of a supporting utility project for a smaller set of deployment use-cases. The Parent Project wraps it all together for me.

When I deploy the API project to the nexus repo, it deploys fine. If i try to make a brand new project that has a depdency on API, it finds the API dependency in nexus but then also wants the Parent project as well. Is there any way to get around publishing the parent project as its really isnt necessary for use of the API lib when used via the nexus repo?

Any tips on how to organize my maven proj to support this?

  • 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-06-13T06:46:53+00:00Added an answer on June 13, 2026 at 6:46 am

    When you add a <parent> reference to a Maven project what you are doing is saying: “Take all the configuration from that parent and inject it into my model, then override with the following”

    Therefore, in order for Maven to build the model of your project, it is necessary for Maven to retrieve the parent itself. In other words, adding a <parent> tag creates an explicit hard dependency between the parent and the child.

    The good news is that Inheritance does not have to follow Aggregation. What does that exactly mean?

    Aggregation is when you list <modules> in your pom. It tells Maven that the reactor (i.e. the set of projects that Maven builds) should also include the following (sub)projects.

    Inheritance is when you set a project’s <parent>.

    Nowhere does Maven enforce that a project’s <parent> has to list its children as <modules> and nowhere does Maven enforce that a projects <modules> must list the project as a <parent>.

    Some people will set up their project like so

    ROOT/
     +- pom.xml
     +- parent/
     |   \- pom.xml
     +- api/
     |   \- pom.xml
     \- packaging/
         \- pom.xml
    

    where the parent of ROOT, api and packaging is actually a child of ROOT. Or sometimes ROOT will be a standalone project with no parent [In fact this is a pattern I use a lot myself. When I am working on several related project I will throw together an aggregating pom.xml on my local disk and open that with my IDE and that way all the related code is available as one single “project”, even though the actual modules may come from different sources]

    So in your case the solution would be to remove the <parent> tag from your “API” module.

    Now! There is a downside. When you remove the <parent> tag from your “API” module you have removed all the defaults that your parent project is providing, so you will need to copy those defaults that are relevant to the “API” project or else you may find subtle changes in behaviour. For example, you should definately copy over the pinning of plugin versions, and any <dependencyManagement> that is relevant to the “API” dependencies. There are other bits you may have to copy, but you should use the Maven command mvn help:effective-pom before and after removing the <parent> tag as an aid to seeing the effective differences

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

Sidebar

Related Questions

Currently, I have a Maven project which inherits from a parent pom defining two
I have a traditional maven setup with parent project and a number of modules
Currently, I have the following structure for my project Foo : foo-parent +- pom.xml
I have parent project parent, which has three modules like: <groupId>com.dummy.bla.bla</groupId> <artifactId>parent</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging>
I have Maven project with a parent module and two children: Service and API
I have the following maven-setup: parent-project |- libraries |- utilities |- core |- component1
Imagine a multi-modules Maven project, such as the following one: parent +- core +-
I have a multi-module Maven project with a parent project P and three sub-modules
I have a parent project with 2 maven modules a simple Java Application (generated
I have some pom files in my project with the following structure <project xmlns=http://maven.apache.org/POM/4.0.0

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.