From 14a594021f65ab8dff9a9d4c6ed923de465f5a6a Mon Sep 17 00:00:00 2001
From: Cedric Beust
-The Packaging plug-in lets you generate various archives for your project: jar, war and zip files, each of them defining a directive by the same name inside the
+ The Packaging
assemble
directive:
+The Packaging plug-in lets you generate (directive assemble
) and install (directive install
) various archives for your project: jar, war and zip files.
assemble
+assemble
directive controls which artifacts get generated for your project.
+
assemble {
jar {
@@ -148,13 +152,13 @@ assemble {
If you don't specify a
name
for your archive, a default one will be used that contains your project name, version and the corresponding suffix, e.g. kobalt-1.1.jar
or sec-0.2.war
.
All these archives are zip files, so the zip
archive is at the top of the hierarchy and jar
and war
inherit all its attributes, which include name
, include
and exclude
.
All archives let you include and exclude files.
@@ -179,7 +183,7 @@ assemble {
The first form, with just one parameter, simply copies the file from your directory into the archive, preserving its path. The second form has three parameters which allow you to move the file to a different path into your archive. Note the use of the from
, to
and glob
directives, which are necessary to disambiguate the call.
A jar
is like a zip
with two additional available parameters:
@@ -208,18 +212,27 @@ assemble {
-
The war
directive generates a war file suitable to be deployed into a servlet container.
The mavenJars
directive generates several jar files (binary, source, javadoc) which are required by Maven repositories. It's basically a shortcut that saves you the trouble from having to assemble these jar files manually in your build file. It allows you to specify Manifest attributes, just like the jar
directive.
+ The install
section lets you specify how the artifacts get installed. If you don't specify any install
directive, then the install
task will do nothing on your project when invoked.
+
+ install { + libDir = "libs" + } +
assemble
) and install (directive install
) various archives for your project: jar, war and zip files.
-
The assemble
directive controls which artifacts get generated for your project.
name
for your archive, a default one will be used that contains your project name, version and the corresponding suffix, e.g. kobalt-1.1.jar
or sec-0.2.war
.
-
All these archives are zip files, so the zip
archive is at the top of the hierarchy and jar
and war
inherit all its attributes, which include name
, include
and exclude
.
All archives let you include and exclude files.
@@ -183,7 +183,7 @@ assemble {
The first form, with just one parameter, simply copies the file from your directory into the archive, preserving its path. The second form has three parameters which allow you to move the file to a different path into your archive. Note the use of the from
, to
and glob
directives, which are necessary to disambiguate the call.
A jar
is like a zip
with two additional available parameters:
@@ -212,19 +212,19 @@ assemble {
-
The war
directive generates a war file suitable to be deployed into a servlet container.
The mavenJars
directive generates several jar files (binary, source, javadoc) which are required by Maven repositories. It's basically a shortcut that saves you the trouble from having to assemble these jar files manually in your build file. It allows you to specify Manifest attributes, just like the jar
directive.
The install
section lets you specify how the artifacts get installed. If you don't specify any install
directive, then the install
task will do nothing on your project when invoked.