You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Miodrag Glumac <mi...@motricity.com> on 2005/10/06 22:02:44 UTC

[m2] creating war from existing wars

What I am trying to accomplish is to create new war file form the set of 
existing wars.  I created two test wars: war1 and war2.  The goal is to 
create new war that will have JSPs from both war1 and war2.  So the 
steps are
                                                                                                                

1.Unpack war1 and war2 files
2.Create new war file using JSPs from unpacked wars
                                                                                                                

I tried to use assembly plugin for this:
                                                                                                                

<assembly>
  <id>war</id>
  <formats>
     <format>war</format>
  </formats>
  .
  .
  .
  <dependencySets>
    <dependencySet>
      <unpack>true</unpack>
      <outputDirectory>/</outputDirectory>
      <includes>
        <include>testwar:war1</include>
        <include>testwar:war2</include>
      </includes>
    </dependencySet>
  </dependencySets>
</assembly>
                                                                                                                

                                                                                                                

However there are problems:
                                                                                                                

First is that assembly plugin does not know how to unpack war file:

Unable to obtain unarchiver for file 
'/testwar/war1/1.0-SNAPSHOT/war1-1.0-SNAPSHOT.war'
                                                                                                                

When I switch to jar it does unpack them but now it cannot create new 
war file:

org.codehaus.plexus.archiver.ArchiverException: webxml attribute is required
                                                                                                                

Can assembly plugin assemble wars?
                                                                                                                

Is there a better way to do this?

Thanks,
Miodrag


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


RE: [m2] creating war from existing wars

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Brett Porter [mailto:brett.porter@gmail.com]
> Sent: samedi 8 octobre 2005 20:11
> To: Maven Users List
> Subject: Re: [m2] creating war from existing wars
> 
> On 10/7/05, Miodrag Glumac <mi...@motricity.com> wrote:
> > First is that assembly plugin does not know how to unpack war file:
> 
> This has been fixed in SVN.
> 
> > org.codehaus.plexus.archiver.ArchiverException: webxml attribute is
> required
> 
> This requires some custom handling - do you want to merge the web.xml
> files? use one or the other? use a dummy?

Not sure if this is relevant but there is code in Cargo for merging web.xml
files. It doesn't support all the elements yet but quite a few.  It's in
org.codehaus.cargo.module.webapp.WebXmlMerger (see
http://tinyurl.com/75qg8).

> I suggest you should write your own plugin for this, leveraging
> maven-archiver like the assembly plugin does.

-Vincent


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


Re: [m2] creating war from existing wars

Posted by Brett Porter <br...@gmail.com>.
On 10/7/05, Miodrag Glumac <mi...@motricity.com> wrote:
> First is that assembly plugin does not know how to unpack war file:

This has been fixed in SVN.

> org.codehaus.plexus.archiver.ArchiverException: webxml attribute is required

This requires some custom handling - do you want to merge the web.xml
files? use one or the other? use a dummy?

I suggest you should write your own plugin for this, leveraging
maven-archiver like the assembly plugin does.

Regards,
Brett

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