maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver B. Fischer" <mails...@swe-blog.net>
Subject Re: .jar is installed as .war
Date Sat, 19 Dec 2015 13:04:14 GMT
Hi,

I decided to create an additional jar while refactoring the the 
buildstructure of an old project not created by me. The integration and 
component tests, which I moved to an separated modul, have dependecies 
to classes of the war producing module. As I can not add a war to the 
classepath I decided to create an additional war out of the classes 
attached to the project. It seemed to me as the best and easiest 
solution wile refactoring the projeckt. And it works for the tests.


Am 19.12.15 um 13:07 schrieb Karl Heinz Marbaise:
> Hi,
>
>
> you can use a configuration option of the maven-war-plugin
> (attachClasses) which will produce a separate jar of the classes you
> have in your war module:
>
> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#attachClasses

I will try this out.

>
>
> This jar is separately installed and can be used by other as a usual
> dependency ...but be aware that you need to use a classifier for this
> artifact..
>
>
> The problem with build-helper-maven-plugin is that is will replace the
> original artifact which is the default...in such cases you should use a
> classifier...

Ok, It could replace the original artifact but it shouldn't be installed 
as war. Replacing would be ok but not installing it twice.

And the description if the attach-artifact goal is

    Attach additional artifacts to be installed and deployed.

Additional means not replacing the original one.

>
> Furthermore you have configured the maven-jar-plugin a second time in
> your build which will also replace the original artifact...cause
> maven-jar-plugin is not being part of the life cycle in case of
> packaging "war"....


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


Mime
View raw message