The one project-one artifact pardigm really restricts maven. 

For example my most common production of multiple artifact is a project
producing both an ejb jar and a  Jboss wsr. This can only be done in one
project because the wsr config and ejb is produced by Xdoclet from the same
source files.

You can produce multiple artifacts using maven.xml
I use

(The key point is to ensure your artifacts are named with different artifact
Ids even though they have different types. This is because in other projects
ie. producing an EAR dependencies with the same artifactId wont both be
included even though they are seperate types)

   <preGoal name="wsr:jar">
      <attainGoal name="xdoclet:ejbdoclet"/>
   </preGoal>

        <goal name="wsr:jar">
                <ant:property name="maven.wsr.file"
value="${maven.build.dir}/${pom.artifactId}-wsr-${pom.currentVersion}.wsr"/>
                <ant:jar destfile="${maven.wsr.file}"
basedir="${maven.build.dir}/xdoclet/wsr" includes="META-INF/web-service.xml"
/> 
        </goal>
        
  <goal name="wsr:install"
        prereqs="wsr:jar"
        description="Install the wsr in the local repository">
     <ant:property name="maven.wsr.filename"
value="${pom.artifactId}-wsr-${pom.currentVersion}.wsr"/>
         <ant:property name="maven.wsr.install.dir"
value="${maven.repo.local}/${pom.artifactDirectory}/wsrs"/>
         <ant:copy file="${maven.build.dir}/${maven.wsr.filename}"
tofile="${maven.wsr.install.dir}/${maven.wsr.filename}"/>
  </goal>       


   <goal name="custom:install-all">
     <attainGoal name="ejb:install" />
     <attainGoal name="wsr:install" />
   </goal>

   <preGoal name="ejb:init">
      <attainGoal name="xdoclet:ejbdoclet"/>
   </preGoal>

   <postGoal name="ejb:install">
      <ant:property name="maven.ejb.install.dir"
value="${maven.repo.local}/${pom.artifactDirectory}/ejbs"/>
      <ant:mkdir dir="${maven.ejb.install.dir}"/>
      <ant:copy file="${maven.build.dir}/${maven.final.name}.jar"
tofile="${maven.ejb.install.dir}/../jars/${maven.final.name}.jar"/>
   </postGoal>

-----Original Message-----
From: David R Robison [mailto:[EMAIL PROTECTED]
Sent: 19 May 2004 12:42
To: Maven Users List; [EMAIL PROTECTED]
Subject: 1 Project, Multiple Atrifacts


Is there a way to set up a project that produces 2 jars without having to
setup
sub projects?

Thanks,
David Robison

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


......................................................................
BUPA
.....................................................................
BUPA House, 15-19 Bloomsbury Way, London, WC1A 2BA
.....................................................................
Internet communications are not secure and therefore BUPA does
not accept legal responsibility for the contents of this message. Any 
views or opinions presented are solely those of the author and do 
not necessarily represent those of BUPA.
.....................................................................

Reply via email to