You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stephen Duncan <st...@gmail.com> on 2005/10/28 14:18:58 UTC

[m2] Complicated Assembly Guidance

I'm trying to automate my normal file release process.  Right now it
takes two assembly descriptors and three commands to accomplish.  Not
too bad, but I'm wondering if there's a better way.  If not, maybe
this use-case can be looked at for ways to improve the assembly
plugin.

The project is a mutli-project with two modules: a jar project and a
war project that is a sample web-app using the jar.

The goal is to produce a directory with the following files:

RELEASE NOTES.txt
OVERVIEW.txt
myapp-version.jar
myapp-version-javadoc.jar
myapp-version-sources.jar
mysampleapp-version.war
MultiProjectSource-version.zip

So, I know have a src/main/assembly in the parent project with two
descriptors.  The first is a source descriptor, src.xml:

<assembly>
	<id>src</id>
	<formats>
		<format>zip</format>
	</formats>
	<fileSets>
		<fileSet>
			<includes>
				<include>*</include>
			</includes>
			<excludes>
				<exclude>.*</exclude>
				<exclude>target</exclude>
			</excludes>
		</fileSet>
		<fileSet>
			<directory>src</directory>
		</fileSet>
		<fileSet>
			<directory>framework/src</directory>
		</fileSet>
		<fileSet>
			<directory>framework</directory>
			<includes>
				<include>*</include>
			</includes>
			<excludes>
				<exclude>.*</exclude>
				<exclude>target</exclude>
			</excludes>
		</fileSet>
		<fileSet>
			<directory>sample/src</directory>
		</fileSet>
		<fileSet>
			<directory>sample</directory>
			<includes>
				<include>*</include>
			</includes>
			<excludes>
				<exclude>.*</exclude>
				<exclude>target</exclude>
			</excludes>
		</fileSet>
	</fileSets>
</assembly>

The second is release.xml:

<assembly>
	<id>release</id>
	<formats>
		<format>zip</format>
	</formats>
	<fileSets>
		<fileSet>
			<includes>
				<include>RELEASE*</include>
				<include>OVERVIEW*</include>
			</includes>
		</fileSet>
		<fileSet>
			<directory>target</directory>
			<outputDirectory></outputDirectory>
			<includes>
				<include>*.zip</include>
			</includes>
		</fileSet>
		<fileSet>
			<directory>framework/target</directory>
			<outputDirectory></outputDirectory>
			<includes>
				<include>*.jar</include>
			</includes>
		</fileSet>
		<fileSet>
			<directory>sample/target</directory>
			<outputDirectory></outputDirectory>
			<includes>
				<include>*.war</include>
			</includes>
		</fileSet>
	</fileSets>
</assembly>

And, finally, I have a shell script that runs the following three commands:

mvn clean package javadoc:jar source:jar
mvn -Ddescriptor=src/main/assembly/src.xml assembly:assembly
mvn -Ddescriptor=src/main/assembly/release.xml assembly:directory

Any ideas on improvement, either in what I've done, or
planned/un-planned improvements in plugins?

--
Stephen Duncan Jr
www.stephenduncanjr.com

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