I don't understand a part of this - you talk about using dependency
properties, but the only thing you want to change per jar is some config
file in the JAR?

What is the different config file? If you always want to generate both,
I think separate projects are ideal, where the second project uses the
assembly plugin to repack the original JAR with the new config file.

If it is one jar produced twice for different environments, profiles are
the right solution. In this way, only one jar is produced in the run,
but the one produced depends on the target environment (using profiles).

- Brett

Vincent Massol wrote:

>Hi,
>
>I'm just implementing the following use case in m1 and I'm wondering whether
>it's already supported in m2.
>
>Imagine you have a project that needs to generate 2 jars. The second jar is
>almost exactly like the first one, except it contains a different config
>file in it. You then want to deploy those 2 jars to a remote repo.
>
>How would you do it?
>
>In m1, I can see 2 solutions, both being a hack:
>
>Solution 1:
>- have 2 projects
>- make the second projet depend on the first one's jar
>- in a maven.xml file, modify the first project's jar to suit the need
>- create a custom deploy goal using the artifact:deploy tag
>
>BTW, I think this solution could be much improved by modifying the jar
>plugin and allowing it to include a jar specified as dependency and tagged
>(say with <jar.bundle>true</jar.bundle>). That may not be enough though if
>the second jar needs to remove files from the first jar...
>
>Solution 2:
>- have a single project
>- create a postgoal to jar:jar in maven.xml to create the second jar
>- create a postgoal to jar:deploy to deploy the second jar using the
>artifact:deploy tag
>
>How would you it with m2? Using the assembly plugin in a second projet to
>create a new jar out of the first one? And then deploy the created jar
>(provided the assembly plugin is modified to add the generated jar as an
>artifact proper - But that's being developed)?
>
>Would you recommend having one project or 2?
>
>I think one project makes more sense. Those 2 jars are really like an
>ejb-jar and the ejb-client. Both made out of the same sources.
>
>Thanks
>-Vincent
>
>
>---------------------------------------------------------------------
>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