Results 1 to 2 of 2
  1. #1
    ZGorlock is offline Member
    Join Date
    Aug 2016
    Posts
    1
    Rep Power
    0

    Default Maven Inheritance Issue

    Hello, I am having a problem setting up my new Maven project.

    So my project consists of a number of modules including one main module. This main module contains a list of plugins and dependencies that every other module should inherit and use. However in order to do this I would need to define the main module as the parent in the child AND define the child as a module in the parent. This will not work for what I am trying to do.

    My project is intended to have any number of child modules that the main module will not know about, so it could not have them listed as modules in its pom. These child modules will include the main module as a dependency and the main module will have no idea they are using it.

    Is there some way for me to make the maven dependencies, plugins, and properties from the main module's pom available to all child modules without the main module's knowledge? There must be a better way than just copying the pom data for each child module.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Maven Inheritance Issue

    You don't have to declare a child module in the parent if all you are doing is using the parent-child structure.
    You just declare, in the child, the parent.
    Java Code:
        <parent>
            <groupId>wibble</groupId>
            <artifactId>wobble</artifactId>
            <version>3</version>
        </parent>
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Is this a Maven issue?
    By edjm1971 in forum Apache Maven
    Replies: 9
    Last Post: 11-12-2014, 05:52 PM
  2. Maven Deloy Issue
    By nareshbabuy4u@gmail.com in forum Apache Maven
    Replies: 1
    Last Post: 02-06-2014, 08:16 AM
  3. Replies: 0
    Last Post: 12-17-2012, 01:32 PM
  4. Inheritance issue
    By powerpravin in forum New To Java
    Replies: 3
    Last Post: 04-12-2011, 06:11 AM
  5. Simple Inheritance issue...
    By AWE in forum New To Java
    Replies: 3
    Last Post: 07-27-2009, 09:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •