You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bs...@apache.org on 2007/10/02 22:54:47 UTC

svn commit: r581381 - /commons/proper/commons-build/trunk/xdocs/releases/prepare.xml

Author: bspeakmon
Date: Tue Oct  2 13:54:46 2007
New Revision: 581381

URL: http://svn.apache.org/viewvc?rev=581381&view=rev
Log:
- add maven 2-specific instructions

Modified:
    commons/proper/commons-build/trunk/xdocs/releases/prepare.xml

Modified: commons/proper/commons-build/trunk/xdocs/releases/prepare.xml
URL: http://svn.apache.org/viewvc/commons/proper/commons-build/trunk/xdocs/releases/prepare.xml?rev=581381&r1=581380&r2=581381&view=diff
==============================================================================
--- commons/proper/commons-build/trunk/xdocs/releases/prepare.xml (original)
+++ commons/proper/commons-build/trunk/xdocs/releases/prepare.xml Tue Oct  2 13:54:46 2007
@@ -154,18 +154,23 @@
     on that JVM. 
         </p>
         <p> 
-    If using maven, the <code>maven.compile.target</code> property in the 
+    If using maven 1, the <code>maven.compile.target</code> property in the 
     <code>project.properties</code> file should be set correctly.
     If using ant, the <code>javac</code> task should have the <code>target</code>
     attribute set correctly.
         </p>
         <p>
-    The maven build now adds entries to the jar's manifest to show the values
+    The maven 1 build now adds entries to the jar's manifest to show the values
     of the <code>maven.compile.source</code> and <code>maven.compile.target</code>
     properties used to generate the jar. For more details on this see sections
     <a href="#checkjarmanifest">Check The Jar Manifest</a> and 
     <a href="#classfileformat">Class File Format</a> for more details.
         </p>
+        <p>
+    For Maven 2 builds, the Commons parent POM specifies default values for 
+    <code>maven.compile.source</code> and <code>maven.compile.target</code>. These
+    values should be overridden in the project's POM if they're not appropriate for it.
+        </p>
     </subsection>
     <subsection name='Check Documentation'>
         <p>
@@ -187,6 +192,21 @@
     maven.dist.src.assembly.dir=${maven.dist.assembly.dir}/src/${maven.final.name}-src  
     </pre>
         </p>
+        <p>
+    Maven 2 builds use assembly descriptors, which by default live in <code>src/assembly</code>.
+    By convention, <code>src.xml</code> is for source distributions and <code>bin.xml</code>
+    is for binary distributions. You can specify the <code>baseDirectory</code> property
+    in <code>src.xml</code> to include -src:
+    <pre>
+<![CDATA[
+<assembly>
+  ...
+  <baseDirectory>${project.artifactId}-${project.version}-src</baseDirectory>
+  ...
+</assembly>
+]]>
+    </pre>
+        </p>
     </subsection>
   </section>
 
@@ -223,6 +243,11 @@
       maven.jar.manifest.attribute.X-Compile-Target-JDK=${maven.compile.target}
         </pre>
         </p>
+        <p>
+        Maven 2 builds have these properties automatically inserted if the POM inherits
+        from the Commons parent POM (org.apache.commons:commons-parent:pom:4). All Commons
+        projects using Maven 2 are vigorously encouraged to use the parent POM.
+        </p>
         <p><strong>Ant Build</strong></p>
         <p>
         If you are using Ant to build the release, then the MANIFEST.MF file at foo/src/conf/MANIFEST.MF
@@ -251,7 +276,7 @@
 	Specification-Title: Apache Commons Foo
 	Specification-Vendor: The Apache Software Foundation
 	Specification-Version: 1.2
-  Implementation-Vendor-Id: org.apache
+	Implementation-Vendor-Id: org.apache
 	Implementation-Title: org.apache.commons.foo
 	Implementation-Vendor: The Apache Software Foundation
 	Implementation-Version: 1.2
@@ -345,7 +370,7 @@
 	be used with the -r option. See issue #752 in the subversion issue tracker at tigris.org.
 	</p>
 	<p>
-	Those using maven should check that the distribution build adds the release notes
+	Those using Maven 1 should check that the distribution build adds the release notes
 	to the binary distributions. It may be necessary to add some scripting to the <code>maven.xml</code>.
 	For example:
 	</p>
@@ -365,6 +390,10 @@
   </preGoal>
 ]]>
 	</pre>
+        <p>
+        Maven 2 users should make sure to configure this in the assembly descriptors in
+        src/assembly as described above.
+        </p>
     </subsection>
 
     <subsection name='Test Against Listed Dependencies'>    
@@ -383,7 +412,7 @@
     <subsection name='Ensure a good build.xml'>
         <p>
         If using Maven, and a hand-built Ant build.xml file does not exist in the project, then
-	ensure that 'maven ant' has been run so a usable build.xml file exists.
+	ensure that 'maven ant' (for Maven 1) or 'mvn ant:ant' (for Maven 2) has been run so a usable build.xml file exists.
         </p>
     </subsection>
 
@@ -482,6 +511,9 @@
   </resources>
 ]]>
 		</pre>
+        <p>
+        Maven 2 builds have this automatically taken care of by the Commons parent POM.
+        </p>
     </subsection>
     <subsection name='Create the Release Candidate'>
         <p>
@@ -525,7 +557,7 @@
 	others to download and verify, the new website should also be published there.
 	</p>
 	<p>
-	Temporarily edit the project.xml file tag &lt;siteDirectory&gt; to point to something like:
+	For Maven 1 builds, temporarily edit the project.xml file tag &lt;siteDirectory&gt; to point to something like:
 	<pre>
 	  &lt;siteDirectory&gt;public_html/foo-1.2rc1/site&lt;/siteDirectory&gt;
 	</pre>
@@ -535,6 +567,37 @@
 	  maven -Dmaven.username=yourapacheid site:deploy
 	</pre>
 	</p>
+        <p>
+        Maven 2 builds should temporarily add a site location to the &lt;distributionManagement&gt;:
+        <pre>
+<![CDATA[
+  <distributionManagement>
+    <id>stagingSite</id>
+    <url>scp://people.apache.org/home/<apacheuser>/public_html/foo-1.2rc1/site</url>
+  </distributionManagement>
+]]>
+        </pre>
+        and then run
+        <pre>
+          mvn site:stage-deploy
+        </pre>
+        To save time entering your username and password, you can edit your
+        <code>~/.m2/settings.xml</code> to specify them:
+        <pre>
+<![CDATA[
+  <settings>
+    <servers>
+      <server>
+        <id>stagingSite</id>
+        <username>...</username>
+        <password>...</password>
+      </server>
+      <server>
+    </servers>
+  </settings>
+]]>
+        </pre>
+        </p>
 	<p>
 	The reports generated by maven (Clover, jCoverage, etc) are very useful things to inspect in this
 	website.
@@ -692,7 +755,8 @@
     included jars.
     </p>
     <p>
-    To make sure that this file is included in maven-generated <i>jars</i>,
+    Maven 2 builds default to including this, so no further effort is required
+    for those projects. To make sure that this file is included in maven 1-generated <i>jars</i>,
     include the following in the build section of your project.xml (or just add the
     resource defined below to the build resources you already have).
     </p>
@@ -729,6 +793,56 @@
 </preGoal>
 ]]>
     </pre>
+    <p>
+    If you use Maven 2, you should also build source and javadocs jars according to Maven 2
+    standards. You can use the following antrun-plugin configuration to accomplish this:
+    <pre>
+<![CDATA[
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <phase>package</phase>
+            <configuration>
+              <tasks>
+                <copy todir="${project.build.directory}/site/api-release">
+                  <fileset dir="${project.build.directory}/site/apidocs"/>
+                </copy>
+                <zip destfile="${project.build.directory}/${artifactId}-${version}-javadoc.jar.new">
+                  <zipfileset src="${project.build.directory}/${artifactId}-${version}-javadoc.jar"/>
+                  <zipfileset dir="." prefix="META-INF">
+                    <include name="LICENSE.txt"/>
+                    <include name="NOTICE.txt"/>
+                  </zipfileset>
+                </zip>
+                <move file="${project.build.directory}/${artifactId}-${version}-javadoc.jar.new"
+                      tofile="${project.build.directory}/${artifactId}-${version}-javadoc.jar"/>
+                <zip destfile="${project.build.directory}/${artifactId}-${version}-sources.jar.new">
+                  <zipfileset src="${project.build.directory}/${artifactId}-${version}-sources.jar"/>
+                  <zipfileset dir="." prefix="META-INF">
+                    <include name="LICENSE.txt"/>
+                    <include name="NOTICE.txt"/>
+                  </zipfileset>
+                </zip>
+                <move file="${project.build.directory}/${artifactId}-${version}-sources.jar.new"
+                      tofile="${project.build.directory}/${artifactId}-${version}-sources.jar"/>
+              </tasks>
+	    </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>  
+  </build>
+]]>
+    </pre>
+    It is a good idea to bind this to a particular profile, such as "release", so that it
+    doesn't run in the default lifecycle and thus in every build.
+    </p>
     </subsection>
   </section>
 
@@ -738,7 +852,7 @@
         </p>
         <p>
         Comments, critiques and error reports -
-        post them any and all to the commons-dev mailing list at jakarta.apache.org. Please prefix with [doc].
+        post them any and all to the dev mailing list at commons.apache.org. Please prefix with [doc].
         </p>
   </section>
  </body>