Author: vsiveton
Date: Sat Jan 19 09:30:45 2008
New Revision: 613428
URL: http://svn.apache.org/viewvc?rev=613428&view=rev
Log:
o added cookbook documentation (related to r613423 and r613414)
Added:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-build-time-to-manifest.apt
(with props)
maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-svn-revision-to-manifest.apt
(with props)
maven/site/trunk/src/site/apt/plugin-developers/cookbook/attach-source-javadoc-artifacts.apt
(with props)
maven/site/trunk/src/site/apt/plugin-developers/cookbook/generate-assembly.apt
(with props)
Modified:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/index.apt
maven/site/trunk/src/site/apt/plugin-developers/index.apt
Added:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-build-time-to-manifest.apt
URL:
http://svn.apache.org/viewvc/maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-build-time-to-manifest.apt?rev=613428&view=auto
==============================================================================
---
maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-build-time-to-manifest.apt
(added)
+++
maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-build-time-to-manifest.apt
Sat Jan 19 09:30:45 2008
@@ -0,0 +1,90 @@
+ -----
+ Cookbook - How To Add Build Time To A JAR Manifest
+ -----
+ Vincent Siveton
+ -----
+ January 2008
+ -----
+
+Cookbook: How To Add Build Time To A JAR Manifest?
+
+* Summary
+
+ This recipe describes how to add build time to a JAR manifest by calling
{{{http://ant.apache.org}Apache Ant}} tasks.
+
+* Prerequisite Plugins
+
+ Here is the list of the plugins used:
+
+*-----------------------------------------------------------+--------------+
+|| <<Plugin>> || <<Version>>
+*-----------------------------------------------------------+--------------+
+| {{{../../plugins/maven-antrun-plugin/} <<<antrun>>>}} | 1.1
+*-----------------------------------------------------------+--------------+
+| {{{../../plugins/maven-jar-plugin/} <<<jar>>>}} | 2.2
+*-----------------------------------------------------------+--------------+
+
+* Sample Generated Manifest
+
++-----+
+Manifest-Version: 1.0
+Archiver-Version: Plexus Archiver
+Created-By: Apache Maven
+Built-By: vsiveton
+Build-Jdk: 1.5.0_12
+Build-Time: 2008-01-18 06:53:13
++-----+
+
+* Recipe
+
+** Configuring MANIFEST.MF
+
+ To generate and add build time into a Jar Manifest, we are using
<<<MANIFEST.MF>>>, located in the <<<src/main/resources/META-INF>>> directory,
+ which contains a built time value to be interpolated, i.e.
+
++-----+
+Build-Time: ${build.time}
++-----+
+
+** Configuring The POM
+
+ The value $\{build.time\} from the <<<MANIFEST.MF>>> will be filtering by
Maven due to the \<filtering\> element.
+ The value is taken from the file
<<<$\{basedir\}/target/filter.properties>>>, listed by the \<filter\> element,
i.e.
+
+%{snippet|id=pom|url=http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-build-time/pom.xml}
+
+** Configuring Maven Antrun Plugin
+
+ The <<<filter.properties>>> file will be generated by the Antrun plugin. We
use two core Ant Tasks,
+ {{{http://ant.apache.org/manual/CoreTasks/tstamp.html}\<tstamp\>}} and
+ {{{http://ant.apache.org/manual/CoreTasks/echo.html}\<echo\>}}.
+
+%{snippet|id=antrun|url=http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-build-time/pom.xml}
+
+** Configuring Maven Jar Plugin
+
+ The last configuration is to set the <<<defaultManifestFile>>> to <<<true>>>
to enable it.
+
+%{snippet|id=jar|url=http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-build-time/pom.xml}
+
+** Running Maven
+
+ Just call Maven to generate the package:
+
++-----+
+mvn package
++-----+
+
+* Other Tips
+
+ You could tweak the Jar Plugin configuration into the War Plugin.
+
+* Resources
+
+ * Source code:
{{{http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-build-time}http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-build-time}}
+
+ * {{{../../plugins/maven-antrun-plugin/} Maven Antrun Plugin}}
+
+ * {{{../../plugins/maven-jar-plugin/} Maven Jar Plugin}}
+
+ []
Propchange:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-build-time-to-manifest.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-build-time-to-manifest.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-svn-revision-to-manifest.apt
URL:
http://svn.apache.org/viewvc/maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-svn-revision-to-manifest.apt?rev=613428&view=auto
==============================================================================
---
maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-svn-revision-to-manifest.apt
(added)
+++
maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-svn-revision-to-manifest.apt
Sat Jan 19 09:30:45 2008
@@ -0,0 +1,74 @@
+ -----
+ Cookbook - How To Add SVN Revision To A JAR Manifest
+ -----
+ Vincent Siveton
+ -----
+ January 2008
+ -----
+
+Cookbook: How To Add SVN Revision To A JAR Manifest?
+
+* Summary
+
+ This recipe describes how to add SVN revision to a JAR manifest.
+
+* Prerequisite Plugins
+
+ Here is the list of the plugins used:
+
+*-----------------------------------------------------------+--------------+
+|| <<Plugin>> || <<Version>>
+*-----------------------------------------------------------+--------------+
+| {{{../../plugins/maven-jar-plugin/} <<<jar>>>}} | 2.2
+*-----------------------------------------------------------+--------------+
+| {{{http://mojo.codehaus.org/buildnumber-maven-plugin/} <<<buildnumber>>>}} |
1.0-beta-1
+*-----------------------------------------------------------+--------------+
+
+* Sample Generated Manifest
+
++-----+
+Manifest-Version: 1.0
+Archiver-Version: Plexus Archiver
+Created-By: Apache Maven
+Built-By: vsiveton
+Build-Jdk: 1.5.0_12
+SCM-Revision: 613393
++-----+
+
+* Recipe
+
+** Configuring Mojo Buildnumber Plugin
+
+ We configure this plugin as suggested in the
{{{http://mojo.codehaus.org/buildnumber-maven-plugin/usage.html}Mojo
Buildnumber Plugin usage}} page.
+
+%{snippet|id=buildnumber|url=http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-svn-revision/pom.xml}
+
+** Configuring Maven Jar Plugin
+
+ The last configuration is to customize the default Manifest with a new entry
for the SCM revision.
+
+%{snippet|id=jar|url=http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-svn-revision/pom.xml}
+
+** Running Maven
+
+ Just call Maven to generate the package:
+
++-----+
+mvn package
++-----+
+
+ <<Note>>: You need to have committed your project into SVN.
+
+* Other Tips
+
+ You could tweak the Jar Plugin configuration into the War Plugin.
+
+* Resources
+
+ * Source code:
{{{http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-svn-revision}http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-svn-revision}}
+
+ * {{{../../plugins/maven-jar-plugin/} Maven Jar Plugin}}
+
+ * {{{http://mojo.codehaus.org/buildnumber-maven-plugin/} Mojo Buildnumber
Maven Plugin}}
+
+ []
Propchange:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-svn-revision-to-manifest.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/add-svn-revision-to-manifest.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/attach-source-javadoc-artifacts.apt
URL:
http://svn.apache.org/viewvc/maven/site/trunk/src/site/apt/plugin-developers/cookbook/attach-source-javadoc-artifacts.apt?rev=613428&view=auto
==============================================================================
---
maven/site/trunk/src/site/apt/plugin-developers/cookbook/attach-source-javadoc-artifacts.apt
(added)
+++
maven/site/trunk/src/site/apt/plugin-developers/cookbook/attach-source-javadoc-artifacts.apt
Sat Jan 19 09:30:45 2008
@@ -0,0 +1,75 @@
+ -----
+ Cookbook - How to attach source and javadoc artifacts
+ -----
+ Vincent Siveton
+ -----
+ January 2008
+ -----
+
+Cookbook: How to attach source and javadoc artifacts?
+
+* Summary
+
+ This recipe describes how to attach source and javadoc artifacts to your
build.
+
+* Prerequisite Plugins
+
+ Here is the list of the plugins used:
+
+*-----------------------------------------------------------+--------------+
+|| <<Plugin>> || <<Version>>
+*-----------------------------------------------------------+--------------+
+| {{{../../plugins/maven-source-plugin/} <<<source>>>}} | 2.0.4
+*-----------------------------------------------------------+--------------+
+| {{{../../plugins/maven-javadoc-plugin/} <<<javadoc>>>}} | 2.3
+*-----------------------------------------------------------+--------------+
+
+* Sample Generated Output
+
++-----+
+
+attach-source-javadoc
+|-- pom.xml
+|-- src\
+`-- target
+ `-- attach-source-javadoc-1.0-SNAPSHOT.jar
+ `-- attach-source-javadoc-1.0-SNAPSHOT-javadoc.jar
+ `-- attach-source-javadoc-1.0-SNAPSHOT-sources.jar
+
++-----+
+
+* Recipe
+
+** Configuring Maven Source Plugin
+
+ We execute the
<<<{{{../../plugins/maven-source-plugin/jar-mojo.html}source:jar}}>>> goal from
the source plugin during the <<<package>>> phase.
+
+%{snippet|id=source|url=http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/attach-source-javadoc/pom.xml}
+
+** Configuring Maven Javadoc Plugin
+
+ Same thing for the
<<<{{{../../plugins/maven-javadoc-plugin/jar-mojo.html}javadoc:jar}}>>> goal
from the javadoc plugin.
+
+%{snippet|id=javadoc|url=http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/attach-source-javadoc/pom.xml}
+
+** Running Maven
+
+ Just call Maven to generate the packages:
+
++-----+
+mvn package
++-----+
+
+* Other Tips
+
+ To improve the build time or for a release, you could also define these
plugins in a profile.
+
+* Resources
+
+ * Source code:
{{{http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/attach-source-javadoc}http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/attach-source-javadoc}}
+
+ * {{{../../plugins/maven-javadoc-plugin/} Maven Javadoc Plugin}}
+
+ * {{{../../plugins/maven-source-plugin/} Maven Source Plugin}}
+
+ []
Propchange:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/attach-source-javadoc-artifacts.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/attach-source-javadoc-artifacts.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/generate-assembly.apt
URL:
http://svn.apache.org/viewvc/maven/site/trunk/src/site/apt/plugin-developers/cookbook/generate-assembly.apt?rev=613428&view=auto
==============================================================================
---
maven/site/trunk/src/site/apt/plugin-developers/cookbook/generate-assembly.apt
(added)
+++
maven/site/trunk/src/site/apt/plugin-developers/cookbook/generate-assembly.apt
Sat Jan 19 09:30:45 2008
@@ -0,0 +1,74 @@
+ -----
+ Cookbook - How To Generate Assembly
+ -----
+ Vincent Siveton
+ -----
+ January 2008
+ -----
+
+Cookbook: How To Generate Assembly?
+
+* Summary
+
+ This recipe describes how to generate assembly like zip, tar.gz or tar.bz2.
+
+* Prerequisite Plugins
+
+ Here is the list of the plugins used:
+
+*-----------------------------------------------------------+--------------+
+|| <<Plugin>> || <<Version>>
+*-----------------------------------------------------------+--------------+
+| {{{../../plugins/maven-assembly-plugin/} <<<assembly>>>}} | 2.2-beta-1
+*-----------------------------------------------------------+--------------+
+
+* Sample Generated Output
+
++-----+
+
+attach-source-javadoc
+|-- pom.xml
+|-- src\
+`-- target
+ `-- apache-maven-cookbook-1.0-SNAPSHOT-bin
+ `-- apache-maven-cookbook-1.0-SNAPSHOT-bin.tar.bz2
+ `-- apache-maven-cookbook-1.0-SNAPSHOT-bin.tar.gz
+ `-- apache-maven-cookbook-1.0-SNAPSHOT-bin.zip
+
++-----+
+
+* Recipe
+
+** Configuring Assembly Descriptor
+
+ To generate an assembly, we need to configure an assembly descriptor called
<<<bin.xml>>> in the <<<src/assembly>>> directory.
+ Firstly, we specify the wanted formats, i.e.
+
+%{snippet|id=formats|url=http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-assembly/src/assembly/bin.xml}
+
+ And the wanted files sets, i.e.
+
+%{snippet|id=fileSets|url=http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-assembly/src/assembly/bin.xml}
+
+** Configuring Maven Assembly Plugin
+
+ We execute the
<<<{{{../../plugins/maven-assembly-plugin/single-mojo.html}assembly:single}}>>>
goal from the Assembly plugin during the
+ <<<package>>> phase.
+
+%{snippet|id=assembly|url=http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-assembly/pom.xml}
+
+** Running Maven
+
+ Just call Maven to generate the packages:
+
++-----+
+mvn package
++-----+
+
+* Resources
+
+ * Source code:
{{{http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-assembly}http://svn.apache.org/repos/asf/maven/sandbox/trunk/site/cookbook/generate-assembly}}
+
+ * {{{../../plugins/maven-assembly-plugin/}Maven Assembly Plugin }}
+
+ []
Propchange:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/generate-assembly.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/site/trunk/src/site/apt/plugin-developers/cookbook/generate-assembly.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: maven/site/trunk/src/site/apt/plugin-developers/cookbook/index.apt
URL:
http://svn.apache.org/viewvc/maven/site/trunk/src/site/apt/plugin-developers/cookbook/index.apt?rev=613428&r1=613427&r2=613428&view=diff
==============================================================================
--- maven/site/trunk/src/site/apt/plugin-developers/cookbook/index.apt
(original)
+++ maven/site/trunk/src/site/apt/plugin-developers/cookbook/index.apt Sat Jan
19 09:30:45 2008
@@ -1,13 +1,33 @@
-----
- Plugin Cookbook
+ Plugins Cookbook
-----
Brett Porter
+ Vincent Siveton
-----
- 3 November 2006
+ January 2008
-----
-Plugin Cookbook
+Maven Plugins Cookbook
- <<COMING SOON!>>
+ A set of small complete working examples projects that demonstrate how to
use Maven Plugins.
+ It is based on commons how-to questions from the
{{{../../mail-lists.html}Maven User Mailing List}}.
- <(Like to help write documentation? See
{{{../../guides/development/guide-helping.html} How to Contribute}})>
+ <(Like to add more cookbooks? See
{{{../../guides/development/guide-helping.html} How to Contribute}} page)>
+
+* How To/Recipes
+
+ * {{{add-build-time-to-manifest.html}How to add build time to a JAR
manifest?}}
+
+ * {{{add-svn-revision-to-manifest.html}How to add SVN revision to a JAR
manifest?}}
+
+ * {{{attach-source-javadoc-artifacts.html}How to attach source and javadoc
artifacts?}}
+
+ * {{{generate-assembly.html}How to generate assembly?}}
+
+ []
+
+* Other Resources
+
+ * {{{http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook}Mojo
Developer Cookbook}}
+
+ []
Modified: maven/site/trunk/src/site/apt/plugin-developers/index.apt
URL:
http://svn.apache.org/viewvc/maven/site/trunk/src/site/apt/plugin-developers/index.apt?rev=613428&r1=613427&r2=613428&view=diff
==============================================================================
--- maven/site/trunk/src/site/apt/plugin-developers/index.apt (original)
+++ maven/site/trunk/src/site/apt/plugin-developers/index.apt Sat Jan 19
09:30:45 2008
@@ -24,7 +24,7 @@
* {{{plugin-documenting.html} Documenting your Plugin}} - How to write
documentation for your plugins
- * {{{cookbook/index.html} Plugin Cookbook}} - Examples for how to perform
common tasks in plugins.
+ * {{{cookbook/index.html} Plugins Cookbook}} - Examples for how to perform
common tasks in plugins.
[]