Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Parent with multi module

 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

i try to improve my knowledge on maven.

i would like to create a parent pom and some module (webapp, service, dao).

i use java 7, spring and netbeans.

my parent pom


nikela-webapps pom


nikela-service pom


when i try to build nikela-service



similar error for others modules and pom

all project is in: /home/collinm/dev/NetBeansProjects/

i tried to put



in parent section of my module, i get same error.

any idea?
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First you need to understand that there are two hierarchy mechanism in Maven: master module - submodule, and parent - child. These are independent concepts - it is not required that you use both simultaneously, like you have done.

I strongly recommend that that your master POM not be the parent POM for any of your submodules. The parent of a child module should reflect the type of module being build. For example, I define parent modules for building JARs, and other for WARs, and another for applications where I need to package the while thing up in a zip. These parent POMs in turn use a common parent POM that contains general things I require of all builds (compiler versions, reports, logging, etc), and that POM in turn has a parent POM used by my organization that defines other standards used by applications in our company (repository location, licensing, etc). The free PDF Maven: the Complete Reference has a good explanation of the differences between the two hierarchy type.

And one final word: I strongly recommend that you not use the "master module - submodule" relationship unless there is no other way to accomplish what you need. I have found that by using a continuous integration server, such as Jenkins, that is very rare to require the use of the "master module - submodule" relationship. In addition, the projects at work who ignored my advice and used a "master module - submodule" relationship anyway are constantly having issues that none of the other projects have.
 
mark smith
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the info

i thought i used paren / child structure
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Having a <submodules> in your pom means you are using the master/submodule hierarchy. The POM containing the section is the master, the ones reference are the submodules.

Having a <parent> section in you pom means you are using the parent/child relationship. The child contains the <parent> entry, the parent module is the one referenced.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic