producing two jars from the same project is a bad plan.

both jars will have the same dependencies, which is almost always exactly what you do not want

better to split the project in to 2, 3, or 4 projects as necessary. not that splitting the project will likely expose elements of bad design.

for example, we had a module which we cannot split because the logically separate parts have circular references (our old ant based build would rebuild the module n! times where n is the number of jar files in our build... this was to be sure to be sure that the circular refs were linking correctly... bootstrapping the build was a nightmare as you needed all the jars to build all the jars... this is very bad design)

when mavenizing we could have gone two ways:

1. lump all the source into one tree and selectivle build each jar with includes/excludes

2. bite the bullet, refactor to remove the circular dependencies and split out into n modules.

we went for option two, and in the process of refactoring we went from n to n+m modules, the additional modules contain interfaces which are used (with DI) to break the circular deps

our code is cleaner, and the build is simpler.

don't fight maven, split into separate modules

Sent from my [rhymes with tryPod] ;-)

On 26 Oct 2009, at 17:06, "Edelson, Justin" <[email protected]> wrote:

You can do this with a second execution of the jar plugin, assuming
there's some easy way to identify the DTO and Interface classes (i.e. by
package/path or file name). See
http://maven.apache.org/plugins/maven-jar-plugin/usage.html. There was
some discussion last week about potential issues with creating two JARs
from the same source tree, so you might also want to look at the list
archives. If it's relatively trivial to break your project into two,
that will likely have some additional upside, if not now than in the
future.

Justin

-----Original Message-----
From: Suneet Shah [mailto:[email protected]]
Sent: Monday, October 26, 2009 12:34 PM
To: [email protected]
Subject: Creating a new Goal

Hello:

I am realitively new to maven and could use some guidance on the
following task.

I have project that current has a mixture of spring and hibernate
objects which I can build fine using maven.
However for another task, I need to create a jar that contains only the
DTO and Interface classes from the first project above.

Whats the best way to approach this? Can I create a new goal like "jar"
to extract and package this? If so, how do I do it?
Alternatively, I can split the project into two. One that contains just the DTO and interfaces and the other which contains the implementations
of these interfaces.

Thanks for your help


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to