[jboss-svn-commits] JBL Code SVN: r30344 - in labs/jbosstm/trunk: maven and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Nov 25 08:21:49 EST 2009


Author: jhalliday
Date: 2009-11-25 08:21:49 -0500 (Wed, 25 Nov 2009)
New Revision: 30344

Added:
   labs/jbosstm/trunk/maven/
   labs/jbosstm/trunk/maven/README.txt
   labs/jbosstm/trunk/maven/pom-template.xml
Modified:
   labs/jbosstm/trunk/build-release-pkgs.xml
   labs/jbosstm/trunk/sharedbuild.xml
Log:
Improve maven release process. JBTM-622


Modified: labs/jbosstm/trunk/build-release-pkgs.xml
===================================================================
--- labs/jbosstm/trunk/build-release-pkgs.xml	2009-11-25 11:55:46 UTC (rev 30343)
+++ labs/jbosstm/trunk/build-release-pkgs.xml	2009-11-25 13:21:49 UTC (rev 30344)
@@ -171,98 +171,87 @@
         <!-- TODO: notes dir, xml generation? project.xml edits -->
     </target>
 
-    <!-- http://wiki.jboss.org/wiki/MavenReleaseRepository -->
+    <!-- copy the release artifacts to the maven repository -->
     <target name="mvn-repository" description="copy the release artifacts to the maven repository">
+
+        <!-- we use ant rather than maven for the build, so we just take the built artifacts
+                and use mvn to deploy them to the repo.  The pom is shared by all artifacts,
+                 with ant pre-processing being used to substitute in appropriate values.
+                 TODO: when we add in proper dependency info we may wind up needing separate
+                 poms for each artifact with a shared parent for common info -->
+
+        <!-- http://wiki.jboss.org/wiki/MavenReleaseRepository -->
+
+        <delete dir="${workdir}/m2"/>
+        <mkdir dir="${workdir}/m2"/>
+
         <delete dir="${workdir}/build"/>
         <mkdir dir="${workdir}/build"/>
+        <unzip src="${workdir}/jbossts-jta-${filename}.zip" dest="${workdir}/build"/>
 
-        <!-- As we don't actually use maven as a build tool this requires a fair bit of black magic.
-         We no longer release the jta jars to maven, just the jts ones. The AS uses these with a -beans.xml
-         config that causes it to function in jta mode and no longer uses a ts properties file at all. -->
+        <!-- jta -->
 
-        <!-- package the JTS -->
+        <mvn-artifact.macro artifact="jbossjta"
+                            file="${workdir}/build/${tag}/lib/jbossjta.jar"/>
+        <mvn-artifact.macro artifact="jbossjta-integration"
+                            file="${workdir}/build/${tag}/lib/jbossjta-integration.jar"/>
 
-        <delete dir="${workdir}/build/${tag}"/>
-        <unzip src="${workdir}/jbossts-full-${filename}.zip" dest="${workdir}/build"/>
 
-        <exec executable="mvn" dir="${workdir}">
-            <arg value="deploy:deploy-file"/>
-            <arg value="-Dfile=${workdir}/build/${tag}/lib/jbossjts.jar"/>
-            <arg value="-Dpackaging=jar"/>
-            <arg value="-Durl=${mvn.url}"/>
-            <arg value="-DrepositoryId=${mvn.repositoryId}"/>
-            <arg value="-DgroupId=jboss.jbossts"/>
-            <arg value="-DartifactId=jbossjts"/>
-            <arg value="-Dversion=${filename}"/>
-            <arg value="-DgeneratePom=true"/>
-        </exec>
 
-        <exec executable="mvn" dir="${workdir}">
-            <arg value="deploy:deploy-file"/>
-            <arg value="-Dfile=${workdir}/build/${tag}/lib/jbossjts-integration.jar"/>
-            <arg value="-Dpackaging=jar"/>
-            <arg value="-Durl=${mvn.url}"/>
-            <arg value="-DrepositoryId=${mvn.repositoryId}"/>
-            <arg value="-DgroupId=jboss.jbossts"/>
-            <arg value="-DartifactId=jbossjts-integration"/>
-            <arg value="-Dversion=${filename}"/>
-            <arg value="-DgeneratePom=true"/>
-        </exec>
+        <delete dir="${workdir}/build"/>
+        <mkdir dir="${workdir}/build"/>
+        <unzip src="${workdir}/jbossts-full-${filename}.zip" dest="${workdir}/build"/>
 
-        <!-- take the object store browser from jts, it will work with jta too -->
-        <exec executable="mvn" dir="${workdir}">
-            <arg value="deploy:deploy-file"/>
-            <arg value="-Dfile=${workdir}/build/${tag}/bin/jbossts-tools.sar"/>
-            <arg value="-Dpackaging=sar"/>
-            <arg value="-Durl=${mvn.url}"/>
-            <arg value="-DrepositoryId=${mvn.repositoryId}"/>
-            <arg value="-DgroupId=jboss.jbossts"/>
-            <arg value="-DartifactId=jbossts-tools"/>
-            <arg value="-Dversion=${filename}"/>
-            <arg value="-DgeneratePom=true"/>
-        </exec>
+        <!-- jts -->
 
-        <!-- resources.jar removed - the AS integration now uses -beans.xml instead of a properties file,
-            so there is no need to mvn the properties files any longer. -->
+        <mvn-artifact.macro artifact="jbossjts"
+                            file="${workdir}/build/${tag}/lib/jbossjts.jar"/>
+        <mvn-artifact.macro artifact="jbossjts-integration"
+                            file="${workdir}/build/${tag}/lib/jbossjts-integration.jar"/>
 
-        <!-- now we do XTS -->
+        <!-- tools -->
 
-        <exec executable="mvn" dir="${workdir}">
-            <arg value="deploy:deploy-file"/>
-            <arg value="-Dfile=${workdir}/build/${tag}/xts/sar/jbossxts.sar"/>
-            <arg value="-Dpackaging=sar"/>
-            <arg value="-Durl=${mvn.url}"/>
-            <arg value="-DrepositoryId=${mvn.repositoryId}"/>
-            <arg value="-DgroupId=jboss.jbossts"/>
-            <arg value="-DartifactId=jbossxts"/>
-            <arg value="-Dversion=${filename}"/>
-            <arg value="-DgeneratePom=true"/>
-        </exec>
+        <mvn-artifact.macro artifact="jbossts-tools" packaging="sar"
+                            file="${workdir}/build/${tag}/bin/jbossts-tools.sar"/>
 
-        <exec executable="mvn" dir="${workdir}">
-            <arg value="deploy:deploy-file"/>
-            <arg value="-Dfile=${workdir}/build/${tag}/xts/tests/jbossxts-tests.zip"/>
-            <arg value="-Dpackaging=zip"/>
-            <arg value="-Durl=${mvn.url}"/>
-            <arg value="-DrepositoryId=${mvn.repositoryId}"/>
-            <arg value="-DgroupId=jboss.jbossts"/>
-            <arg value="-DartifactId=jbossxts-tests"/>
-            <arg value="-Dversion=${filename}"/>
-            <arg value="-DgeneratePom=true"/>
-        </exec>
+        <!-- xts -->
 
-        <exec executable="mvn" dir="${workdir}">
-            <arg value="deploy:deploy-file"/>
-            <arg value="-Dfile=${workdir}/build/${tag}/xts/interop-tests/jbossxts-interop-tests.zip"/>
-            <arg value="-Dpackaging=zip"/>
-            <arg value="-Durl=${mvn.url}"/>
-            <arg value="-DrepositoryId=${mvn.repositoryId}"/>
-            <arg value="-DgroupId=jboss.jbossts"/>
-            <arg value="-DartifactId=jbossxts-interop-tests"/>
-            <arg value="-Dversion=${filename}"/>
-            <arg value="-DgeneratePom=true"/>
-        </exec>
+        <mvn-artifact.macro artifact="jbossxts" packaging="sar"
+                            file="${workdir}/build/${tag}/xts/sar/jbossxts.sar"/>
+        <mvn-artifact.macro artifact="jbossxts-tests" packaging="zip"
+                            file="${workdir}/build/${tag}/xts/tests/jbossxts-tests.zip"/>
+        <mvn-artifact.macro artifact="jbossxts-interop-tests" packaging="zip"
+                            file="${workdir}/build/${tag}/xts/interop-tests/jbossxts-interop-tests.zip"/>
 
     </target>
 
+    <!-- macro to process a pom template into an actual pom and use it with mvn deploy-file to upload to the repo -->
+    <macrodef name="mvn-artifact.macro">
+
+        <attribute name="artifact"/>
+        <attribute name="file"/>
+        <attribute name="packaging" default="jar"/>
+
+        <sequential>
+            <copy  file="${workdir}/build/${tag}/maven/pom-template.xml"
+                   tofile="${workdir}/build/${tag}/pom-@{artifact}.xml"
+                   filtering="true">
+                <filterset>
+                    <filter token="artifact" value="@{artifact}"/>
+                    <filter token="version" value="${filename}"/>
+                    <filter token="packaging" value="@{packaging}"/>
+                </filterset>
+            </copy>
+
+            <exec executable="mvn" dir="${workdir}">
+                <arg value="deploy:deploy-file"/>
+                <arg value="-Dfile=@{file}"/>
+                <arg value="-DrepositoryId=${mvn.repositoryId}"/>
+                <arg value="-Durl=${mvn.url}"/>
+                <arg value="-DpomFile=${workdir}/build/${tag}/pom-@{artifact}.xml"/>
+            </exec>
+        </sequential>
+        
+   </macrodef>
+
 </project>

Added: labs/jbosstm/trunk/maven/README.txt
===================================================================
--- labs/jbosstm/trunk/maven/README.txt	                        (rev 0)
+++ labs/jbosstm/trunk/maven/README.txt	2009-11-25 13:21:49 UTC (rev 30344)
@@ -0,0 +1,5 @@
+
+We don't actually use maven for building the project. However, the artifacts we produce should be available
+for consumption by maven based projects. Therefore, we use ../build-release-pkgs.xml to drive mvn deploy-file
+to upload them to the jboss repository. The pom in this file is a template processed by build-release-pkgs.xml
+and should not be called directly from maven.

Added: labs/jbosstm/trunk/maven/pom-template.xml
===================================================================
--- labs/jbosstm/trunk/maven/pom-template.xml	                        (rev 0)
+++ labs/jbosstm/trunk/maven/pom-template.xml	2009-11-25 13:21:49 UTC (rev 30344)
@@ -0,0 +1,146 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2009, Red Hat Middleware LLC, and individual contributors
+  as indicated by the @author tags.
+  See the copyright.txt in the distribution for a
+  full listing of individual contributors.
+  This copyrighted material is made available to anyone wishing to use,
+  modify, copy, or redistribute it subject to the terms and conditions
+  of the GNU Lesser General Public License, v. 2.1.
+  This program is distributed in the hope that it will be useful, but WITHOUT A
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+  PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+  MA  02110-1301, USA.
+
+  (C) 2009,
+  @author JBoss Inc. (jonathan.halliday at redhat.com)
+-->
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>jboss.jbossts</groupId>
+    <artifactId>@artifact@</artifactId>
+    <packaging>@packaging@</packaging>
+    <version>@version@</version>
+    <name>JBossTS @artifact@</name>
+
+    <description>JBossTS - JBoss Transaction Service. JTA, JTS and XTS (WS-AT, WS-BA)</description>
+
+    <url>http://www.jboss.org/jbosstm/</url>
+    <issueManagement>
+        <system>JIRA</system>
+        <url>https://jira.jboss.org/jira/browse/JBTM/</url>
+    </issueManagement>
+    <ciManagement>
+        <system>hudson</system>
+        <url>http://hudson.qa.jboss.com/hudson/view/JBossTS/</url>
+    </ciManagement>
+
+    <developers>
+
+        <developer>
+            <id>jhalliday</id>
+            <name>Jonathan Halliday</name>
+            <email>jonathan.halliday at redhat.com</email>
+            <organization>JBoss</organization>
+            <organizationUrl>http://www.jboss.org/</organizationUrl>
+            <roles>
+                <role>project lead</role>
+            </roles>
+            <timezone>0</timezone>
+        </developer>
+
+        <developer>
+            <id>adinn</id>
+            <name>Andrew Dinn</name>
+            <email>adinn at redhat.com</email>
+            <organization>JBoss</organization>
+            <organizationUrl>http://www.jboss.org/</organizationUrl>
+            <roles>
+                <role>XTS lead</role>
+            </roles>
+            <timezone>0</timezone>
+        </developer>
+
+        <developer>
+            <id>mmusgrov</id>
+            <name>Michael Musgrove</name>
+            <email>mmusgrov at redhat.com</email>
+            <organization>JBoss</organization>
+            <organizationUrl>http://www.jboss.org/</organizationUrl>
+            <roles>
+                <role>Core Developer</role>
+            </roles>
+            <timezone>0</timezone>
+        </developer>
+
+        <developer>
+            <id>mark.little at jboss.com</id>
+            <name>Mark Little</name>
+            <email>mlittle at redhat.com</email>
+            <organization>JBoss</organization>
+            <organizationUrl>http://www.jboss.org/</organizationUrl>
+            <roles>
+                <role>JBoss CTO</role>
+            </roles>
+            <timezone>0</timezone>
+        </developer>
+
+        <developer>
+            <id>istudens at redhat.com</id>
+            <name>Ivo Studensky</name>
+            <email>istudens at redhat.com</email>
+            <organization>JBoss</organization>
+            <organizationUrl>http://www.jboss.org/</organizationUrl>
+            <roles>
+                <role>QA lead</role>
+            </roles>
+            <timezone>0</timezone>
+        </developer>
+
+    </developers>
+
+    <licenses>
+        <license>
+            <name>LGPL 2.1</name>
+            <url>http://www.gnu.org/licenses/lgpl-2.1.html</url>
+        </license>
+    </licenses>
+
+    <scm>
+        <connection>scm:svn:http://anonsvn.jboss.org/repos/labs/labs/jbosstm/</connection>
+        <developerConnection>scm:svn:https://svn.jboss.org/repos/labs/labs/jbosstm/</developerConnection>
+        <url>http://fisheye.jboss.org/browse/JBossTS/</url>
+    </scm>
+
+    <repositories>
+      <repository>
+      <id>repository.jboss.org</id>
+      <name>JBoss Releases Repository</name>
+      <url>http://repository.jboss.org/maven2</url>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+    </repository>
+    <repository>
+      <id>snapshots.jboss.org</id>
+      <name>JBoss Snapshots Repository</name>
+      <url>http://snapshots.jboss.org/maven2</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+    </repositories>
+
+</project>
\ No newline at end of file

Modified: labs/jbosstm/trunk/sharedbuild.xml
===================================================================
--- labs/jbosstm/trunk/sharedbuild.xml	2009-11-25 11:55:46 UTC (rev 30343)
+++ labs/jbosstm/trunk/sharedbuild.xml	2009-11-25 13:21:49 UTC (rev 30344)
@@ -111,9 +111,7 @@
             failonerror="false"/>
 
         <delete file="${build.dir}/lib/${modulename}.jar"/>
-            <tstamp>
-                <format property="buildproperty.date" pattern="yyyy/MMM/dd HH:mm"/>
-            </tstamp>
+
         <jar jarfile="${build.dir}/lib/${modulename}.jar"
              basedir="${build.dir}/classes">
             <manifest>
@@ -258,7 +256,9 @@
 
         <!-- note: build-release-pkgs.xml overrides this property when approptiate: -->
         <property name="com.hp.mw.sourceid" value="unknown"/>
-
+        <tstamp>
+            <format property="buildproperty.date" pattern="yyyy/MMM/dd HH:mm"/>
+        </tstamp>
         <jar jarfile="${build.dir}/lib/${modulename}.jar">
             <fileset dir="${build.dir}" includes="built_using*"/>
             <fileset dir="${build.dir}" includes="default-jbossts-properties.xml"/>



More information about the jboss-svn-commits mailing list