1

There is a complex multi module project I am working on to move from ant. Things we want to achieve are:

  1. Ease of development, and packaging for developer.

Example: Parent Project SON A

         Parent Project
              SON 
                  GRANDSON A
                  GRANDSON B
              DAUGTER (DEPENDS ON SON)
                  GRANDSON C
                  GRANDSON D

What I want is that when a developer is working on Daughter Project he just downloads the parent project and the SON dependency should be resolved from svn repository. I know it can be done by defining dependecy in pom.xml but that will conflict with my second requirement.

2) To download all daughters and sons of the parent project and compile them so that build consistently can be checked by automated build manager like Jenkins. And in addition I would also like to release the revisions on a flag to the maven repository if the build is successful. Please note that revision needs to be head of each module.

3) In both the procedure I want to create a tar file or my own style directories which will contain different jars in different directory as per my need. (I can achieve this by adding ant copy command; any better Idea on same)

What are the standard approaches in maven to achieve it.

Boj
  • 3,923
  • 3
  • 22
  • 39
ManMohan Vyas
  • 4,004
  • 4
  • 27
  • 40
  • Do you keep each subproject in its own SVN repository? Do you have a local Maven artifact repository such as Nexus? – Boj Dec 02 '14 at 11:18
  • Yes I would like to keep it in seperate repo. and yes I work with archiva - local Maven artifact manager – ManMohan Vyas Dec 02 '14 at 11:19
  • If you like to build them together you should keep them into a single svn repository or to be more accurate into a the same trunk. Otherwise you are going the wrong way. – khmarbaise Dec 02 '14 at 11:40

1 Answers1

0

In your Maven hierarchy, only the leaf projects (the grandchildren in your example) will be actual modules that contain code and produce an artifact (e.g. a jar). The internal nodes (Parent, Son, Daughter) will only be used to hold common configuration and dependencies that are shared by modules down the hierarchy. Therefore, Daughter cannot depend on Son, but Grandson C can depend on Grandson A, for instance.

If the parent project hierarchy have their own life cycle, i.e. the poms can be released independently, they should be on their on SVN module. Developers working on submodules do not even need to download these poms, as they would be automatically retrieved from your Archiva, if they are deployed there by Jenkins. See this answer for a similar situation.

However, you see to indicate you wish to build and release all modules are the same time. In this case, you can have the same pom hierarchy by keep all projects in the same SVN repository.

Community
  • 1
  • 1
Boj
  • 3,923
  • 3
  • 22
  • 39