You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Hirn, Joseph" <Jo...@cmegroup.com> on 2007/11/13 23:47:38 UTC

Two jars, one pom...

I am helping someone implement Maven in their project and looking for
the best way to go about generating two jars from the same source base.
They did this previously via two ant targets. Please note we are
retrofitting this codebase to Maven so it was not originally structured
with Maven's "project" structure in mind. 

The option to break up the project into two separate projects seems like
the ideal way. They need an "ALL" jar and a client jar for distribution.
>From what was explained, it might need to be three components where
there are server, client, and shared code. This would result in three
POMS and three jars which does not simplify distribution as they would
like a single "ALL" jar rather than having three separate artifacts. 

The other option would be to have a separate profile which compiles the
client jar but that doesn't seem "mavenish", and I'm not 1000% sure it
can be supported .

If there is a third way I would appreciate the recommendation. I also
would like to hear thoughts on my two approaches and if anyone has had
to deal with separating out things in this manner. 

Thanks so much. 

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


RE: Two jars, one pom...

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
The multi module is the correct way to go. You might be able to combine
them using the assembly plugin and the jar with dependencies stuff.

-----Original Message-----
From: Hirn, Joseph [mailto:Joseph.Hirn@cmegroup.com] 
Sent: Tuesday, November 13, 2007 11:48 PM
To: Maven Users List; taras.lipatov@vidavee.com
Subject: Two jars, one pom... 

I am helping someone implement Maven in their project and looking for
the best way to go about generating two jars from the same source base.
They did this previously via two ant targets. Please note we are
retrofitting this codebase to Maven so it was not originally structured
with Maven's "project" structure in mind. 

The option to break up the project into two separate projects seems like
the ideal way. They need an "ALL" jar and a client jar for distribution.
>From what was explained, it might need to be three components where
there are server, client, and shared code. This would result in three
POMS and three jars which does not simplify distribution as they would
like a single "ALL" jar rather than having three separate artifacts. 

The other option would be to have a separate profile which compiles the
client jar but that doesn't seem "mavenish", and I'm not 1000% sure it
can be supported .

If there is a third way I would appreciate the recommendation. I also
would like to hear thoughts on my two approaches and if anyone has had
to deal with separating out things in this manner. 

Thanks so much. 

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


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


Re: Two jars, one pom...

Posted by Antonio Petrelli <an...@gmail.com>.
2007/11/13, Hirn, Joseph <Jo...@cmegroup.com>:
> If there is a third way I would appreciate the recommendation. I also
> would like to hear thoughts on my two approaches and if anyone has had
> to deal with separating out things in this manner.

Possibly the solution could be to separate these jars into atomic
modules (i.e. that they do not need to be separated anymore) and then
"aggregating" them in an "all" jar using the "assembly" plugin:
http://maven.apache.org/plugins/maven-assembly-plugin/
This is in some way how Spring 2 is packaged: they provide modular
jars for Maven, but they also provide a "spring-all" jar containing
all the Spring.

Ciao
Antonio

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


Re: Two jars, one pom...

Posted by Lee Meador <le...@leemeador.com>.
We have a similar situation where we build a jar that goes into a rar
file but we need a client jar as well. We build one of the files with
an ant task (after maven has done all the compiling and such) and use
the build-helper plugin to add the extra resulting artifact file to
the list of things to install and deploy. Works like a charm.

It's similar to the situation where the ejb plugin generates an ejb
jar and a client jar too. The difference is that the ejb plugin adds
its own support for having two artifacts as a result.

-- Lee

On Nov 13, 2007 4:47 PM, Hirn, Joseph <Jo...@cmegroup.com> wrote:
> I am helping someone implement Maven in their project and looking for
> the best way to go about generating two jars from the same source base.
> They did this previously via two ant targets. Please note we are
> retrofitting this codebase to Maven so it was not originally structured
> with Maven's "project" structure in mind.
>
> The option to break up the project into two separate projects seems like
> the ideal way. They need an "ALL" jar and a client jar for distribution.
> From what was explained, it might need to be three components where
> there are server, client, and shared code. This would result in three
> POMS and three jars which does not simplify distribution as they would
> like a single "ALL" jar rather than having three separate artifacts.
>
> The other option would be to have a separate profile which compiles the
> client jar but that doesn't seem "mavenish", and I'm not 1000% sure it
> can be supported .
>
> If there is a third way I would appreciate the recommendation. I also
> would like to hear thoughts on my two approaches and if anyone has had
> to deal with separating out things in this manner.
>
> Thanks so much.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 
-- Lee Meador
Sent from gmail. My real email address is lee AT leemeador.com

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