commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "matthew.hawthorne" <ma...@apache.org>
Subject Re: [resources] An interesting problem
Date Fri, 27 Aug 2004 20:29:29 GMT
James Mitchell wrote:
> Currently the project.xml produces commons-resources-1.0-dev.jar
> 
> Can you help me with how I need to tell maven to create a 2nd artifact?
> 
> Something like commons-resources-tests-1.0-dev.jar

The cleanest way is to split the project into 2 subprojects.

commons-resources/
   core/
     src/
       main/

   tests/
     src/
       main/

Make the 2nd project depend on the 1st.  You could do maven 
multiproject:install
in the commons-resources directory to build them both.

However, a lot of people find this undesirable.  You could do some maven.xml
magic to make this happen instead, and keep everything in one source tree.

Here's an example of how I did this, before I switched to the 
multiproject format.

<!-- Builds and deploys test jar -->
<postGoal name="jar:jar">
         <ant:jar destfile="${maven.build.dir}/${testjar.name}">
             <fileset dir="${maven.build.dir}/test-classes"/>
         </ant:jar>
</postGoal>

define the property 'testjar.name' as whatever you want.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message