maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Heinz Marbaise <k...@soebes.de>
Subject Re: Sharing Module among Multiple Projects
Date Thu, 21 Jan 2010 09:54:03 GMT

Hi,



> | - SharedLibrary
> |   ` pom.xml
> | - AdminWebApp
> |   ` pom.xml
> | - PublicWebApp
> |   ` pom.xml
> | - MediaProcessor
>     ` pom.xml
> 
If i understand your project correct all these "Modules" are needed for your
full project....

basically you can define the SharedLibrary as a dependency in each of your
parts AdminWebApp, PublicWebApp and MediaProcess (or which of your parts
uses the SharedLibrary)...

But i would suggest to create a parent:

  MyWebApp
   !        +-- pom.xml
   +--- SharedLib
            +-- pom.xml
   +--- AdminWebApp
            +-- pom.xml
   +--- PublicWebApp
            +-- pom.xml
   +--- MediaProcessor
            +-- pom.xml

and define in the root pom the modules


<modules>
  <module>AdminWebApp</module>
  <module>PublicWebApp</module>
  <module>MediaProcesssor</module>
  <module>SharedLibrary</module>
</modules>

and define inside the modules if it needs the SharedLibrary as dependency:

e.g. AdminWebApp:
   <dependencies>
    ...
    <dependency>
     <groupId>...</groupId>
     <artifactId>SharedLibrary</artifactId>
   </dependency>
  <dependencies>

and in all modules you have to give a parent:

  <parent>
     <groupId>...</groupId>
     <artifactId>mywebapp-parent</artifactId>
     <version>1.0-SNAPSHOT</version>
  </parent>

This will guaranty that the order of building is always correct, cause it
will be handled by Maven...

Just can simply can call mvn install or mvn package from the root of your
project....

Kind regards
Karl Heinz Marbaise
-- 
View this message in context: http://old.nabble.com/Sharing-Module-among-Multiple-Projects-tp27254872p27255259.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message