Author: epunzalan
Date: Mon Jul 31 00:37:20 2006
New Revision: 427036
URL: http://svn.apache.org/viewvc?rev=427036&view=rev
Log:
PR: MASSEMBLY-130
Submitted by: Baerrach bonDierne
With some minor revisions to the patch.
Provided additional example and improved some docs on the supported archives.
Added:
maven/plugins/trunk/maven-assembly-plugin/src/site/apt/examples/single/including-and-excluding-artifacts.apt
Modified:
maven/plugins/trunk/maven-assembly-plugin/src/site/apt/examples/single/index.apt
maven/plugins/trunk/maven-assembly-plugin/src/site/apt/features.apt
maven/plugins/trunk/maven-assembly-plugin/src/site/apt/index.apt
maven/plugins/trunk/maven-assembly-plugin/src/site/apt/usage.apt
maven/plugins/trunk/maven-assembly-plugin/src/site/site.xml
Added:
maven/plugins/trunk/maven-assembly-plugin/src/site/apt/examples/single/including-and-excluding-artifacts.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/site/apt/examples/single/including-and-excluding-artifacts.apt?rev=427036&view=auto
==============================================================================
---
maven/plugins/trunk/maven-assembly-plugin/src/site/apt/examples/single/including-and-excluding-artifacts.apt
(added)
+++
maven/plugins/trunk/maven-assembly-plugin/src/site/apt/examples/single/including-and-excluding-artifacts.apt
Mon Jul 31 00:37:20 2006
@@ -0,0 +1,74 @@
+ ---
+ Including and Excluding Artifacts
+ ---
+ Barrie Treloar
+ ---
+ 31-July-2006
+ ---
+
+~~ Copyright 2006 The Apache Software Foundation.
+~~
+~~ Licensed under the Apache License, Version 2.0 (the "License");
+~~ you may not use this file except in compliance with the License.
+~~ You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+
+Including and Excluding Artifacts
+
+ Currently the include/exclude format is based upon the dependency conflict id
+ which has a form of: <<<groupId:artifactId:type:classifier>>>. A shortened
+ form of the dependency conflict id may also be used <<<groupId:artifactId>>>.
+
+ The check for inclusion/exclusion is done based on either the dependency
+ conflict id or the shortened form as a <<<String.equals()>>> so it must
+ be an identical match for it to be included or excluded. At present there is
+ no support for regular expressions.
+
+ This example excludes the log4j and commons-lang jar files from the assembly.
+ This would be useful when you are building a super distribution assembly
which
+ contained sub distributions (i.e. other already assembled zips or tars) where
+ in your pom you are depenedent upon those distributions. But because the
+ distributions transitively depend upon the project's dependencies the
assembly
+ also includes the jar files (which are already in the assemblies and don't
+ need to be duplicated)
+
+ Your pom might include something like:
+
+-----
+ <dependencies>
+ <dependency>
+ <groupId>YOUR GROUP</groupId>
+ <artifactId>YOUR ARTIFACT</artifactId>
+ <version>YOUR VERSION</version>
+ <classifier>bin</classifier>
+ <type>zip</type>
+ </dependency>
+-----
+
+ And then in your assembly you exclude all the jar dependencies pulled in
+ from the binary assembly. In this example the commons-lang and log4j jars
+ are included unnecessarily (as they are in the bin.zip file already)
+
+-----
+ <dependencySets>
+ <dependencySet>
+ ....
+ <excludes>
+ <exclude>commons-lang:commons-lang</exclude>
+ <exclude>log4j:log4j</exclude>
+ </excludes>
+ </dependencySet>
+ ....
+ </dependencySets>
+-----
Modified:
maven/plugins/trunk/maven-assembly-plugin/src/site/apt/examples/single/index.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/site/apt/examples/single/index.apt?rev=427036&r1=427035&r2=427036&view=diff
==============================================================================
---
maven/plugins/trunk/maven-assembly-plugin/src/site/apt/examples/single/index.apt
(original)
+++
maven/plugins/trunk/maven-assembly-plugin/src/site/apt/examples/single/index.apt
Mon Jul 31 00:37:20 2006
@@ -32,6 +32,8 @@
* {{{filtering-some-distribution-files.html}Filtering Some Distribution
Files}}
+ * {{{include-and-exclude.html}Include/Exclude Artifacts}}
+
* {{{using-components.html}Using Component Descriptors}}
* {{{using-repositories.html}Using Repositories}}
Modified: maven/plugins/trunk/maven-assembly-plugin/src/site/apt/features.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/site/apt/features.apt?rev=427036&r1=427035&r2=427036&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/site/apt/features.apt
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/site/apt/features.apt Mon Jul
31 00:37:20 2006
@@ -42,7 +42,9 @@
* Reusable assembly-descriptor components <[2.1]>
- * Supported archive formats include: tar.gz, tar.bz2, zip, jar
+ * Supported archive formats include: zip, tar, tar.gz, tar.bz2, jar, dir, war
+ (and any other format that the ArchiveManager has been configured for).
+
* Directory-only assemblies
Modified: maven/plugins/trunk/maven-assembly-plugin/src/site/apt/index.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/site/apt/index.apt?rev=427036&r1=427035&r2=427036&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/site/apt/index.apt (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/site/apt/index.apt Mon Jul 31
00:37:20 2006
@@ -47,6 +47,12 @@
* jar
+ * dir
+
+ * war
+
+ * and any other format that the ArchiveManager has been configured for
+
To use the Assembly Plugin in Maven 2, you simply need to:
* choose or write the assembly descriptor to use,
Modified: maven/plugins/trunk/maven-assembly-plugin/src/site/apt/usage.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/site/apt/usage.apt?rev=427036&r1=427035&r2=427036&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/site/apt/usage.apt (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/site/apt/usage.apt Mon Jul 31
00:37:20 2006
@@ -39,7 +39,11 @@
you're using a custom assembly descriptor, you give it the path to the
descriptor. Note that a single invocation of the Assembly Plugin can actually
produce assemblies from multiple descriptors, allowing you maximum
flexibility
- to customize the suite of binaries your project produces.
+ to customize the suite of binaries your project produces. When the assembly
is
+ created it will use the assemblyId as the artifact's classifier and will
attach
+ the created assembly to the project and will be uploaded into the repository
+ on an install and deploy goal.
+
For example, imagine that our project produces a jar. If we want to create an
assembly binary that includes our project's dependencies, we can take
Modified: maven/plugins/trunk/maven-assembly-plugin/src/site/site.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/site/site.xml?rev=427036&r1=427035&r2=427036&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/site/site.xml (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/site/site.xml Mon Jul 31
00:37:20 2006
@@ -45,6 +45,7 @@
<item name="Examples Index" href="examples/index.html"/>
<item name="Single Project" collapse="false"
href="examples/single/index.html">
<item name="Filtering Some Distribution Files"
href="examples/single/filtering-some-distribution-files.html"/>
+ <item name="Include/Exclude Artifacts"
href="examples/single/include-and-exclude.html"/>
<item name="Using Component Descriptors"
href="examples/single/using-components.html"/>
<item name="Using Repositories"
href="examples/single/using-repositories.html"/>
</item>