[Copying Nicolas who asked me about the exact same thing]

On 10/21/05, Mikael Wikström <[EMAIL PROTECTED]> wrote:
> I have a bundle of war files, one main and a number of sub-projects all
> containing jar's/properties/html/xsl and more, that I want to
> merge/repack into a single war (or simply deploy into a container as a
> single webapp). Has anyone solved this problem before? I'm trying to
> solve it with the assembly plugin but it's not a very simple nor clean
> solution.

Mikael:

1- I've posted about the exact same thing earlier about 8 hours ago on
the same list. You may want to monitor that email thread. The email
was titled "using assembly to repackage a war".

2- as described in my email (and the issue I opened here [1]) I am
hitting an issue using the assembly to package wars. I was told on IRC
#maven that the assembly is not to be used for war packaging, but to
me it's currently the cleanest solution. I will probably investigate
the issue. Feel free to track the issue as well.

3- As Nicolas asked me, you will find below the scripts I am using to
do a simple bundling.

The use case is the following: one war and 2 zips produced. The zip
files contain webstart applications. I want to unzip the zip files in
the correct place in the webapp.

4- Would be happy to know from both Nicolas and you what are your
exact use cases. If fixing the assembly plugin to support war assembly
is not an option, we might need to create a new goal for the war
plugin.

[1] http://jira.codehaus.org/browse/MNG-1274

Cheers,

Jerome
the pom.xml

<?xml version="1.0"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <parent>    [...]   </parent>
  <artifactId>full-webapp</artifactId>
  <packaging>pom</packaging>
   [...]

  <dependencies>

    <dependency>
      <groupId>myproject</groupId>
      <artifactId>webapp</artifactId>
      <version>${version}</version>
      <type>war</type>
    </dependency>

    <dependency>
      <groupId>myproject</groupId>
      <artifactId>webstart1</artifactId>
      <version>${version}</version>
      <type>zip</type>
    </dependency>

    <dependency>
      <groupId>myproject</groupId>
      <artifactId>webstart2</artifactId>
      <version>${version}</version>
      <type>zip</type>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
           <execution>
              <phase>install</phase> <!-- note: this doesn't work right now -->
           </execution>
        </executions>
        <configuration>
          <descriptor>src/assemble/main.xml</descriptor>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>

the assembly

<assembly>
  <id>main</id>
  <formats>
    <format>war</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <dependencySets>
    <dependencySet>
      <outputDirectory>/</outputDirectory>
      <includes>
        <include>myproject:webapp</include>
      </includes>
      <unpack>true</unpack>
      <scope>runtime</scope>
    </dependencySet>
    <dependencySet>
      <outputDirectory>webapp1</outputDirectory>
      <includes>
        <include>myproject:webapp1</include>
      </includes>
      <unpack>true</unpack>
      <scope>runtime</scope>
    </dependencySet>
    <dependencySet>
      <outputDirectory>webapp2</outputDirectory>
      <includes>
        <include>myproject:webapp2</include>
      </includes>
      <unpack>true</unpack>
      <scope>runtime</scope>
    </dependencySet>
  </dependencySets>
</assembly>

That's pretty simple.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to