You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by kalebral <ka...@gmail.com> on 2007/11/26 21:17:55 UTC
using assembly to create a war file
Using maven 2.0.7 - I have a project that creates a war file. I want to
modify the war file and rename some of the files based on the current
project version. So my assembly.xml looks like:
<assembly>
<id>distribution</id>
<formats>
<format>war</format>
</formats>
<files>
<file>
<filtered>true</filtered>
<source>src/main/webapp/scripts/shared.js</source>
<destName>scripts/shared-${project.version}.js</destName>
</file>
<file>
<filtered>true</filtered>
<source>src/main/webapp/scripts/global.js</source>
<destName>scripts/global-${project.version}.js</destName>
</file>
</files>
<fileSets>
<fileSet>
<directory>target/cp-${project.version}/</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>**/*</include>
<exclude>scripts/global.js</exclude>
<exclude>scripts/shared.js</exclude>
</includes>
</fileSet>
</fileSets>
</assembly>
All this works fine and creates a new war file except for two issues
1 - The new war file created by assembly has an extra directory level at
the top, in the listing below I want everything below cp0-1.1.0-SNAPSHOT,
just like the war file that is initially created by maven
Archive: target//cp-1.1.0-SNAPSHOT-distribution.war
Length Date Time Name
-------- ---- ---- ----
0 11-26-07 11:57 META-INF/
110 11-26-07 11:57 META-INF/MANIFEST.MF
0 11-26-07 11:57 cp-1.1.0-SNAPSHOT/
0 11-26-07 11:57 cp-1.1.0-SNAPSHOT/scripts/
0 11-26-07 11:57 cp-1.1.0-SNAPSHOT/scripts/maps/
0 11-26-07 11:57 cp-1.1.0-SNAPSHOT/scripts/thirdparty/
0 11-26-07 11:57 cp-1.1.0-SNAPSHOT/scripts/yui/
0 11-26-07 11:57 cp-1.1.0-SNAPSHOT/scripts/ga/
0 11-26-07 11:57 cp-1.1.0-SNAPSHOT/scripts/hardcore/
0 11-26-07 11:57 cp-1.1.0-SNAPSHOT/scripts/hardcore/dtree/
0 11-26-07 11:57 cp-1.1.0-SNAPSHOT/scripts/hardcore/webeditor/
0 11-26-07 11:57
cp-1.1.0-SNAPSHOT/scripts/hardcore/webeditor/dtree/
0 11-26-07 11:57 cp-1.1.0-SNAPSHOT/scripts/hardcore/upload/
............
2 - the exclude statements are not working, those files are still included
in the newly assembled war file
Any ideas??
thanks, Lee
--
View this message in context: http://www.nabble.com/using-assembly-to-create-a-war-file-tf4877643s177.html#a13957672
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org