Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Maven User
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e3RvYzppbmRlbnQ9MjBweHxzdHlsZT1kaXNjfQ&locale=en_GB&version=2" data-macro-name="toc" data-macro-parameters="indent=20px|style=disc"> <h2>Links</h2> <ul> <li><a href="http://maven.apache.org/guides/mini/guide-assemblies.html">Guide to creating assemblies</a></li> <li><a href="http://maven.apache.org/plugins/maven-assembly-plugin/howto.html">How to use assembly plugin</a> - good</li> <li><a href="http://maven.apache.org/plugins/maven-assembly-plugin/descriptor.html">Predefined Descriptors</a> - very useful</li> <li><a href="http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html">Descriptor format</a> - most descriptors have no description</li> <li><a class="confluence-link" href="/display/MAVENUSER/Pre-defined+Descriptor+Files" data-linked-resource-id="135397815" data-linked-resource-type="page" data-linked-resource-default-alias="Pre-defined Descriptor Files" data-base-url="http://docs.codehaus.org">Pre-defined Descriptor Files</a></li> </ul> <h2>Goals</h2> <ul> <li>assembly:assembly (default goal) Creates a distribution artifact</li> <li>assembly:directory copies files into a directory structure without packing those file</li> <li>assembly:unpack unpacks packed files</li> </ul> <h2>Descriptors</h2> <p>An assembly file consists of three sections</p> <h3>General assembly properties</h3> <table class="confluenceTable"><tbody> <tr> <td class="confluenceTd"><p> <id> </p></td> <td class="confluenceTd"><p> the id. </p></td> </tr> <tr> <td class="confluenceTd"><p> <formats> </p></td> <td class="confluenceTd"><p> list of package formats that should be generated, each in <format> descriptor </p></td> </tr> <tr> <td class="confluenceTd"><p> <format> </p></td> <td class="confluenceTd"><p> jar, tar.gz, tar.bz2, zip <em>if you know of others, please add them here</em> </p></td> </tr> <tr> <td class="confluenceTd"><p> <includeBaseDirectory> </p></td> <td class="confluenceTd"><p> defaults to false. Determines if the base directory should be included in the package. </p></td> </tr> </tbody></table> <h3><filesets></h3> <table class="confluenceTable"><tbody> <tr> <td class="confluenceTd"><p> <outputDirectory> </p></td> <td class="confluenceTd"><p> Directory in the target tree where the files should be copied to. </p></td> </tr> <tr> <td class="confluenceTd"><p> <directory> </p></td> <td class="confluenceTd"><p> copies the contents of this directory to the specified target directory. Copies files by name, does not copy path. <em>if anyone could clarify what other types of patterns can be specified that would be great!</em> </p></td> </tr> <tr> <td class="confluenceTd"><p> <includes> </p></td> <td class="confluenceTd"><p> copies the specified files that match the pattern (e.g. *.txt) to the target directory. Includes the directory path when copying. </p></td> </tr> <tr> <td class="confluenceTd"><p> <excludes> </p></td> <td class="confluenceTd"><p> Excludes the specified files that match the pattern (e.g. *.txt) from being copied to the target directory. </p></td> </tr> <tr> <td class="confluenceTd"><p> <lineEnding> </p></td> <td class="confluenceTd"><p> </p></td> </tr> <tr> <td class="confluenceTd"><p> <directoryMode> </p></td> <td class="confluenceTd"><p> </p></td> </tr> <tr> <td class="confluenceTd"><p> <fileMode> </p></td> <td class="confluenceTd"><p> </p></td> </tr> </tbody></table> <h3><dependencySets></h3> <table class="confluenceTable"><tbody> <tr> <td class="confluenceTd"><p> <outputDirectory> </p></td> <td class="confluenceTd"><p> Directory in the target tree where the dependencies should be copied to. </p></td> </tr> <tr> <td class="confluenceTd"><p> <includes> </p></td> <td class="confluenceTd"><p> Includes the specified dependency </p></td> </tr> <tr> <td class="confluenceTd"><p> <excludes> </p></td> <td class="confluenceTd"><p> Excludes the specified dependency </p></td> </tr> <tr> <td class="confluenceTd"><p> <unpack> </p></td> <td class="confluenceTd"><p> Unpacks the contents of the dependencies </p></td> </tr> <tr> <td class="confluenceTd"><p> <scope> </p></td> <td class="confluenceTd"><p> </p></td> </tr> <tr> <td class="confluenceTd"><p> <outputFileNameMapping> </p></td> <td class="confluenceTd"><p> </p></td> </tr> <tr> <td class="confluenceTd"><p> <directoryMode> </p></td> <td class="confluenceTd"><p> </p></td> </tr> <tr> <td class="confluenceTd"><p> <fileMode> </p></td> <td class="confluenceTd"><p> </p></td> </tr> </tbody></table> <h2>How To</h2> <h3>How to Escape Variable in archetype templates</h3> <p>If you have seen WARNING during your archetype:create run with message that says parameter "blah" is not defined, then it's because you have a dollar sign variables in your archetype template files that's not escaped.</p> <p>Any file under src/main/resources/archetyp-resources are consider templates and will process by Velicity engine. Variables such as ${artifactId}, ${goupId}, and ${version} will get substitued for value during runtime when you create the archetype. But if you need to specifically want ${artifactId} to not get substituted, then you need to escape it. The easiest way is add this on top of src/main/resources/archetyp-resources/pom.xml</p> <p>#set($dollar = '$')</p> <p>Then any variable you want to escape can be written in the form of ${dollar}{artifactId}. This ${dollar} variable will visible to all template files, which comes in handy if you need to generated JSP pages that want EL expression stays intact.</p> <h3>How to copy files into some target directory structure without packaging.</h3> <p>This can be accomplished with the assembly:directory goal. There is only a small downside: The directory<br /> goal always creates a folder below the target directory that is version-specific. This version-specific directory<br /> is even created when <includeBaseDirectory> is set to false (that may be a bug).</p> <h3>How to create your own predefine assembly:</h3> <p>This explains how to create your own predefine assembly and make it available to other projects using a simple refId.</p> <ol> <li>Create a simple jar module <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><project ...> <artifactId>myAssemblies</artifactId> <groupId>com.mycompany.mygroup</groupId> <version>1.0.0</version> <packaging>jar</packaging> </project> </pre></td></tr></table> Your project just need to contain the assambly descriptor file (the directory "assemblies" is required):<br /> src/main/resources/assemblies/<strong>my-distribution.xml</strong><br /> the name of your assembly ("my-distribution") is the refId that will be use in descriptorRef tag.<br /> In this project be sure to disable filtering on resources folder otherwise variables like ${artifactId} will be replaced....</li> <li>Then in a pom parent (my-pom-parent) you need to declare the assembly configuration: <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><build> <pluginManagement> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>my-distribution</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>my-assembly</id> <phase>package</phase> <goals> <goal>assembly</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupId>com.mycompany.mygroup</groupId> <artifactId>myAssemblies</artifactId> <version>1.0.0</version> </dependency> </dependencies> </plugin> </plugins> </pluginManagement> </build> </pre></td></tr></table> "pluginManagement" is used in this example, but you can directly use "plugins" tag in your project.</li> <li>And Then in your project (that inherite from the "my-pom-parent") you just need to declare the usage of the assembly plugin: <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> </plugin> </plugins> </build> </pre></td></tr></table> Of course you can overwrite default plugin configuration.</li> </ol> <h2>Tips</h2> <p>Use the <a class="confluence-link" href="/display/MAVENUSER/Remote+Resources+Plugin" data-linked-resource-id="78338" data-linked-resource-type="page" data-linked-resource-default-alias="Remote Resources Plugin" data-base-url="http://docs.codehaus.org">Remote Resources Plugin</a> to process LICENSE and NOTICE files for inclusion in your assembly</p> <h3>Assembly Plugin 2.2-beta-1 Issues</h3> <p>From #maven 20070713</p> <table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><wsmoak> jdcasey: what version of the assembly plugin do you recommend using ? I haven't been following it closely. <jdcasey> I'm partial to the 2.2-b-2-snap, but 2.2-beta-1 is okay, provided you know some things <jdcasey> what are you trying to do with it? <wsmoak> make assemblies :) what things? <jdcasey> e.g. if you need to unpack dependencies, you'll have to set <outputFileNameMapping></outputFileNameMapping> (blank) <jdcasey> lol <jdcasey> that's the big one <jdcasey> it's fixed in 2.2b2-snap <jdcasey> fwiw <jdcasey> wsmoak: and we're still trying to work out the kinks in repo building...that one's troublesome <jdcasey> I think those are the biggies </pre></td></tr></table> <h3>Assemblies not installing or deploying?</h3> <ul> <li>Count the number of statements under [INFO] [install:install], it might actually be getting installed under a name you don't expect.<br /> For example using variables in your id fields can easily create an artifact that looks very much like your main artifact when installing or deploying (myproject-1.5.0.0-SNAPSHOT.war and myproject-1.5.0.0-SNAPSHOT-1.5.0.0-SNAPSHOT.zip)</li> </ul>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced