You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by pu...@thesofa.de on 2008/05/08 17:14:28 UTC

Fwd: RE: WAR-Plugin: Manifest and true not working :-/


----- Weitergeleitete Nachricht von public@thesofa.de -----
      Datum: Wed,  7 May 2008 16:31:47 +0200
        Von: public@thesofa.de
Antwort an: public@thesofa.de
    Betreff: RE: WAR-Plugin: Manifest and <optional>true</optional>  
not working :-/
         An: Jörg Schaible <Jo...@Elsag-Solutions.com>

Hello,

thank you. This article helped me to solve the problem.

But what comes into my mind is the question of having a mixed mode.
Some Jars in the EAR for all Wars and some specific Jars into WEB-INF/lib.
Could be helpfull to  some Classloader Issues.
I asumed, that setting the optional flag to a pom would transitive be
maped on the containing artifacts. But what the MavenProject Class does in the
getArtifacts Method is passing back each artifact of the pom without
having the optional flag to be set to true though they should inherit this
from the POM where theMavenProject has them from. With using scope
provided it works though. Then the artifacts are not being passed back
on method project.getArtifacts().

In my opinion it would make it easy to apply the optional value to the
pom child aswell. This way you could add a POM (and the transient
deps) as optional but have jars being placed in WEB-INF/lib aswell.

The way I solved it now with the help of the Article, you can have
either all or
none.

Or am I missing some Architectural Issues of maven at this point. I am not
too dep into maven yet.

Thank you for your help. Now I can move on :-)

Regards,
         Alexander

Zitat von Jörg Schaible <Jo...@Elsag-Solutions.com>:

>
> Read this:
> http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html
>
> public@thesofa.de wrote:
>> Hello everybody,
>>
>> I am currently having some trouble with the war plugin and
>> could need
>> some help.
>> The issue is about the manifest file and adding the dependent jar to
>> its classpath BUT excluding it from the WEB-INF/lib folder.
>>
>> http://maven.apache.org/plugins/maven-war-plugin/examples/war-
>> manifest-guide.html
>>
>> I already read the war-manifest-guide and set the attribute
>> <optional>true</optional> in the dependency. Having done this, the
>> manifest file is being written absolutely correct. All the jars are
>> being placed into the classpath.
>> But the jars as well are being placed into the WEB-INF/lib folder
>> which I expected not to happen, regarding the three cases at the
>> bottom of the guide.
>>
>> The dependency  I use is a pom that wraps all the dependent
>> jars together.
>>
>> 				<dependency>
>>
>> <groupId>com.example.eap</groupId>
>>
>> <artifactId>EAP_3rd-party_Library</artifactId>
>>
>> <version>0.0.1-SNAPSHOT</version>
>> 					<type>pom</type>
>> 					<optional>true</optional>
>> 				</dependency>
>>
>> The reason why I am doing this is that I have an EAR as the
>> top level
>> artifact that is being created. Within this EAR I have three
>> WARs that
>> all do use the same dependencies and need to share them.
>> That?s why I
>> want to set those jars to optional in the WARs and reinclude them in
>> the EAR.
>>
>>
>>
>> This does all work perfectly fine except that the jars are being
>> placed into the WEB-INF/lib though set to optional in the pom.
>> I already tried to set the dependencie to provided aswell, but this
>> just acted as if I had set only the provided scope. No jars in
>> WEB-INF/lib BUT no Classpath inclusion in manifest file aswell.
>>
>> Does anyone have an idea or suggenstion how I could fix this
>> or what I
>> might be doing wrong?
>>
>>
>> Thank you for any help,
>>                                  Alexander
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>




----- Ende der weitergeleiteten Nachricht -----


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