You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Tales R. Heredia" <ta...@terra.com.br> on 2007/06/22 18:54:38 UTC

Create 2 JAR of almost same project

Hi all,

I need to create 2 JAR files of almost same project, but is there a 
little difference between 3 source files.
My initial idea is create 2 project.xml and call each project at 
maven.xml changing this 3 files when I'll call the second project to 
create the second JAR file...But I guess that this is not the best approach.
Another idea is separate this subproject in 2 subprojects, one with all 
source code, and another one with just 3 different files, but I really 
don't know who can I set my project.xml to get the source files from 
another project and the 3 files of current project.

Thanks,
Tales


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


Re: Create 2 JAR of almost same project

Posted by Keith Beattie <ks...@gmail.com>.
On 6/22/07, Tales R. Heredia <ta...@terra.com.br> wrote:
>
> Hi all,
>
> I need to create 2 JAR files of almost same project, but is there a
> little difference between 3 source files.
> My initial idea is create 2 project.xml and call each project at
> maven.xml changing this 3 files when I'll call the second project to
> create the second JAR file...But I guess that this is not the best
> approach.
> Another idea is separate this subproject in 2 subprojects, one with all
> source code, and another one with just 3 different files, but I really
> don't know who can I set my project.xml to get the source files from
> another project and the 3 files of current project.
>
> Thanks,
> Tales


I have a similar problem, which I don't know how to solve and will post
separately, but for your situation I'd look into the assembly plugin and try
using separate descriptors for each jar you want to create.  Start with
reading the following:

http://maven.apache.org/plugins/maven-assembly-plugin/index.html
http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/using-components.html

(Given that you mention a maven.xml and not a pom.xml, this might require
that you move to Maven2...)

HTH,
ksb