You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Aneesh K raj <ne...@rediffmail.com> on 2010/08/08 11:39:00 UTC

war dependent on another war

hi,

i am having trouble having classes of a war in the classpath for another war..
am using maven 2.x jdk1.5 windows 7

i had added the below to the pom.xml for the dependent war but it didnt work out..


  ..
  ..
  ..
  war
  ..

Re: war dependent on another war

Posted by Benson Margulies <bi...@gmail.com>.
An alternative is an overlay. This is perhaps overkill for just some classes.

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <overlays>
                        <overlay>
                            <groupId>com.basistech.jug</groupId>
                            <artifactId>gate-home</artifactId>
                            <classifier>gate-home</classifier>
                            <type>zip</type>
                            <targetPath>WEB-INF</targetPath>
                        </overlay>
                    </overlays>
                </configuration>
            </plugin>



On Sun, Aug 8, 2010 at 5:53 AM, Mark Struberg <st...@yahoo.de> wrote:
> checked our Jira and found http://jira.codehaus.org/browse/MWAR-73 from 2006.
> I'll check if parts are still missing and fix it or set the jira to resolved if
> all is ok nowadays.
>
> LieGrue,
> strub
>
>
>
> ----- Original Message ----
>> From: Mark Struberg <st...@yahoo.de>
>> To: Maven Users List <us...@maven.apache.org>
>> Sent: Sun, August 8, 2010 11:48:57 AM
>> Subject: Re: war dependent on another war
>>
>> Hi!
>>
>> Use the 'archiveClasses' and 'attachClasses' [1] options of the
>>maven-war-plugin
>>
>> in your first WAR file. This way all your classes of this  war will get jared
>>and
>>
>> used this way in WEB-INF/lib as jar instead of  WEB-INF/classes. The 2nd option
>>
>> will tell maven to treat this jar as  'attached artifact' [2]. If you look at
>> your local repository in  ~/.m2/repository/... for your WAR, you will see a
>> '..-webclasses.jar' (not  100% sure about the qualifier name, this got changed
>
>> since I first hacked  this years ago). You can then use this jar as dependency
>
>> with this  classifier. The groupId and artifactId are the ones from your WAR
>> file.
>>
>>
>> LieGrue,
>> strub
>>
>> [1]
>>http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#attachClasses
>> [2]
>>http://docs.codehaus.org/display/MAVEN/Packaging+vs+Type+-+Derived+and+Attached+Artifacts
>>s
>>
>>
>>
>> ----- - Original Message ----
>> > From: Aneesh K raj <ne...@rediffmail.com>
>> >  To: users@maven.apache.org
>> > Sent:  Sun, August 8, 2010 11:39:00 AM
>> > Subject: war dependent on another  war
>> >
>> > hi,
>> >
>> > i am having trouble having classes of  a war in the classpath for  another
>> war..
>> > am using maven 2.x  jdk1.5 windows 7
>> >
>> > i had added the  below to the pom.xml for  the dependent war but it didnt
>>work
>>
>> >out..
>> >
>> >
>> >   ..
>> >   ..
>> >   ..
>> >    war
>> >    ..
>> >
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>

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


Re: war dependent on another war

Posted by Mark Struberg <st...@yahoo.de>.
checked our Jira and found http://jira.codehaus.org/browse/MWAR-73 from 2006. 
I'll check if parts are still missing and fix it or set the jira to resolved if 
all is ok nowadays.

LieGrue,
strub



----- Original Message ----
> From: Mark Struberg <st...@yahoo.de>
> To: Maven Users List <us...@maven.apache.org>
> Sent: Sun, August 8, 2010 11:48:57 AM
> Subject: Re: war dependent on another war
> 
> Hi!
> 
> Use the 'archiveClasses' and 'attachClasses' [1] options of the  
>maven-war-plugin 
>
> in your first WAR file. This way all your classes of this  war will get jared 
>and 
>
> used this way in WEB-INF/lib as jar instead of  WEB-INF/classes. The 2nd option 
>
> will tell maven to treat this jar as  'attached artifact' [2]. If you look at 
> your local repository in  ~/.m2/repository/... for your WAR, you will see a 
> '..-webclasses.jar' (not  100% sure about the qualifier name, this got changed 

> since I first hacked  this years ago). You can then use this jar as dependency 

> with this  classifier. The groupId and artifactId are the ones from your WAR 
> file.
> 
> 
> LieGrue,
> strub
> 
> [1]  
>http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#attachClasses
> [2] 
>http://docs.codehaus.org/display/MAVEN/Packaging+vs+Type+-+Derived+and+Attached+Artifacts
>s
> 
> 
> 
> ----- - Original Message ----
> > From: Aneesh K raj <ne...@rediffmail.com>
> >  To: users@maven.apache.org
> > Sent:  Sun, August 8, 2010 11:39:00 AM
> > Subject: war dependent on another  war
> > 
> > hi,
> > 
> > i am having trouble having classes of  a war in the classpath for  another 
> war..
> > am using maven 2.x  jdk1.5 windows 7
> > 
> > i had added the  below to the pom.xml for  the dependent war but it didnt 
>work  
>
> >out..
> > 
> > 
> >   ..
> >   ..
> >   ..
> >    war
> >    ..
> > 
> 
> 
>       
> 
> ---------------------------------------------------------------------
> 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


Re: war dependent on another war

Posted by Mark Struberg <st...@yahoo.de>.
Hi!

Use the 'archiveClasses' and 'attachClasses' [1] options of the maven-war-plugin 
in your first WAR file. This way all your classes of this war will get jared and 
used this way in WEB-INF/lib as jar instead of WEB-INF/classes. The 2nd option 
will tell maven to treat this jar as 'attached artifact' [2]. If you look at 
your local repository in ~/.m2/repository/... for your WAR, you will see a 
'..-webclasses.jar' (not 100% sure about the qualifier name, this got changed 
since I first hacked this years ago). You can then use this jar as dependency 
with this classifier. The groupId and artifactId are the ones from your WAR 
file.


LieGrue,
strub

[1] http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#attachClasses
[2] 
http://docs.codehaus.org/display/MAVEN/Packaging+vs+Type+-+Derived+and+Attached+Artifacts



----- Original Message ----
> From: Aneesh K raj <ne...@rediffmail.com>
> To: users@maven.apache.org
> Sent: Sun, August 8, 2010 11:39:00 AM
> Subject: war dependent on another war
> 
> hi,
> 
> i am having trouble having classes of a war in the classpath for  another 
war..
> am using maven 2.x jdk1.5 windows 7
> 
> i had added the  below to the pom.xml for the dependent war but it didnt work  
>out..
> 
> 
>   ..
>   ..
>   ..
>   war
>    ..
> 


      

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


Re: war dependent on another war

Posted by Wayne Fay <wa...@gmail.com>.
> i am having trouble having classes of a war in the classpath for another war..
> am using maven 2.x jdk1.5 windows 7

Your classes should be moved to a library jar that both wars depend upon.

Wayne

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