Maven can do damn near anything. That does not mean that it should.

The first advice was right.
Split MyJar to remove the classes to make a MyJar-common of all the classes that you always want. Make MyJar-common a dependency of a smaller MyJar that only has the 3 classes. Make your other jars depend on the either MyJar-common (war) of the new MyJar which has all the classes(mostly by dependency)

That is the "Maven Way". You and Maven will remain friends if you do this.
It may also be easier to maintain as your project grows since it starts you down the road to smaller more functionally-oriented projects that are more stable in the same way that functional design at the code level helps make software more robust and reduces the scope of maintenance activity.

Other ways to make your end-result happen will piss-off Maven and get you into a war of attrition which you will eventually give up on and go back to the advice that you got, in order to restore your relationship with Maven.

"Resistance is futile".

Ron


On 19/10/2012 9:04 AM, kenduron wrote:
Am 19.10.2012 14:32, schrieb Thomas Sundberg:
On 19 October 2012 10:15, kenduron <[email protected]> wrote:
Hello,

perhaps you can help me.

I got a WAR (web archive) which is built with maven.
It works perfectly.

mvn clean package install

But from now on, I need to create and additional special version of this war from the same code base. In this special version, some modification will be
done:

- some classes are removed from the war (indeed controller classes)
- a configuration file is changed

the special version is a limited version of the normal version.

It should be deployed with a special tag, e.g.

MyWar - Version 1.0.0 - specialEdition.

Probably not, it should be deployed with a specific name that differs
it from the normal artifact. Not a special tag.


Is this possible with maven?

Yes

If so, how?

You divide your project in different modules. Everything common should
be in a common module, anything specific should be in a specific
module. Typically one module per artifact.

The common module should create a jar that the specific modules depends on.
These specific modules should all depend om the common module, add
it's specific difference and finally produce a war as deployable
artifact.

This would be the Maven way. Common things in one module, specific
things in specific modules.

Thank you, but maybe you got it wrong.
My Project is already separated in the following way

MyJar.jar
MyWar.war
MyEear.ear

During the build of the war, some 3 class files should be removed, like this

del src/main/java/.../controller/SpecialAdmin1Controller.java
del src/main/java/.../controller/SpecialAdmin2Controller.java
del src/main/java/.../controller/SpecialAdmin3Controller.java

Can this done with maven without separating?




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




--
Ron Wheeler
President
Artifact Software Inc
email: [email protected]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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

Reply via email to