You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2006/06/21 04:46:39 UTC

svn commit: r415874 - /maven/site/trunk/src/site/apt/guides/mini/guide-archive-configuration.apt

Author: brett
Date: Tue Jun 20 19:46:39 2006
New Revision: 415874

URL: http://svn.apache.org/viewvc?rev=415874&view=rev
Log:
add archive config doc

Added:
    maven/site/trunk/src/site/apt/guides/mini/guide-archive-configuration.apt
      - copied, changed from r413930, maven/site/trunk/src/site/apt/guides/mini/guide-manifest.apt

Copied: maven/site/trunk/src/site/apt/guides/mini/guide-archive-configuration.apt (from r413930, maven/site/trunk/src/site/apt/guides/mini/guide-manifest.apt)
URL: http://svn.apache.org/viewvc/maven/site/trunk/src/site/apt/guides/mini/guide-archive-configuration.apt?p2=maven/site/trunk/src/site/apt/guides/mini/guide-archive-configuration.apt&p1=maven/site/trunk/src/site/apt/guides/mini/guide-manifest.apt&r1=413930&r2=415874&rev=415874&view=diff
==============================================================================
--- maven/site/trunk/src/site/apt/guides/mini/guide-manifest.apt (original)
+++ maven/site/trunk/src/site/apt/guides/mini/guide-archive-configuration.apt Tue Jun 20 19:46:39 2006
@@ -1,95 +1,35 @@
  ------
- Guide to Working with Manifests
+ Guide to Configuring Archive Plugins
  ------
- Jason van Zyl
+ Brett Porter
  ------
- 12 October 2005
+ 21 June 2006
  ------
 
-Guide to Working with Manifests
+Guide to Configuring Archive Plugins
 
- In order to modify the manifest of the resultant JAR produced by the jar plug-in you need to create a configuration
- for the jar plug-in. In this first example we'll add some entries to the manifest by specifying what we'd like
- in the <<<configuration>>> element of the jar plug-in:
+ Many Java archive generating plugins accept the <<<archive>>> configuration element to customise the generation of the archive.
+ In the standard Maven Plugins, this includes the <<<jar>>>, <<<war>>>, <<<ejb>>>, <<<ear>>> and <<<assembly>>> plugins.
 
-+----+
-
-<project>
-  ...
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <configuration>
-          <archive>
-            <manifestEntries>
-              <mode>development</mode>
-              <url>${pom.url}</url>
-            </manifestEntries>
-          </archive>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  ...
-</project>
-
-+----+
-
- As you see above you can use literal values or you can have values from the POM interpolated into literals
- or simply use straight POM expressions. So this is what your resultant <<<MANIFEST.MF>>> will look like inside
- the generated JAR:
-
-+----+
-
-Manifest-Version: 1.0
-Archiver-Version: Plexus Archiver
-Created-By: Apache Maven
-Built-By: jvanzyl
-Build-Jdk: 1.4.2_09
-Extension-Name: my-app
-Specification-Vendor: MyCompany Inc
-Implementation-Vendor: MyCompany Inc
-Implementation-Title: my-app
-Implementation-Version: 1.0-SNAPSHOT
-mode: development
-url: http://maven.apache.org
+* Disabling Maven Meta Information
 
-+----+
+ By default, Maven generated archives include the <<<META-INF/maven>>> directory, which contains the <<<pom.xml>>> file used to
+ build the archive, and a <<<pom.properties>>> file that includes some basic properties in a small, easier to read format.
 
- If you need to do more then simply add some manifest entries there are more options like activating indexing of the
- JAR, setting the main-class, packageName ... Here's an example of what the <<<configuration>>> element of the
- JAR plug-in might look like:
+ To disable the generation of these files, include the following configuration for your plugin (in this example, the WAR plugin
+ is used):
 
 +----+
-
 <project>
   ...
   <build>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
+        <artifactId>maven-war-plugin</artifactId>
         <configuration>
           <archive>
-            <!--
-            <index>true</true>
-            -->
-            <manifest>
-              <mainClass>com.mycompany.app.App</mainClass>
-              <packageName>com.mycompany.app</packageName>
-              <!-- options
-              <manifestFile>/path/to/MANIFEST.MF</manifestFile>
-              <addClasspath>true</addClasspath>
-              <addExtensions/>
-              <classpathPrefix/>
-              -->
-            </manifest>
-            <manifestEntries>
-              <mode>development</mode>
-              <url>${pom.url}</url>
-            </manifestEntries>
+            <addMavenDescriptor>false</addMavenDescriptor>
           </archive>
         </configuration>
       </plugin>
@@ -100,31 +40,11 @@
 
 +----+
 
- So this is what your resultant <<<MANIFEST.MF>>> will look like inside the generated JAR:
+~~ other things: index, compress
 
-+----+
+* Configuring the Manifest
+
+  The archive configuration also accepts manifest configuration. See {{{guide-manifest.html}} Guide to Working with Manifests} for more information.
 
-Manifest-Version: 1.0
-Archiver-Version: Plexus Archiver
-Created-By: Apache Maven
-Built-By: jvanzyl
-Package: org.com.foo.app
-Build-Jdk: 1.4.2_09
-Extension-Name: my-app
-Specification-Vendor: MyCompany Inc
-Implementation-Vendor: MyCompany Inc
-Implementation-Title: my-app
-Implementation-Version: 1.0-SNAPSHOT
-Main-Class: org.com.foo.App
-mode: development
-url: http://maven.apache.org
 
-+----+
 
-~~ suggestion by jorg
-~~ it would be nice if the Specification-Version could be easily generated to be major.minor of pom.currentVersion i.e. that
-~~
-~~ 1.2 ==> 1.2
-~~ 1.2.1 ==> 1.2
-~~ 1.2-SNAPSHOT ==> 1.2
-~~ for the javaapp-plugin I did something like this in Jelly ...