[jboss-svn-commits] JBL Code SVN: r30345 - 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 10:14:47 EST 2009


Author: jhalliday
Date: 2009-11-25 10:14:47 -0500 (Wed, 25 Nov 2009)
New Revision: 30345

Modified:
   labs/jbosstm/trunk/build-release-pkgs.xml
   labs/jbosstm/trunk/maven/pom-template.xml
   labs/jbosstm/trunk/sharedbuild.xml
Log:
build changes for mvn release of -sources.jar artifacts. JBTM-662


Modified: labs/jbosstm/trunk/build-release-pkgs.xml
===================================================================
--- labs/jbosstm/trunk/build-release-pkgs.xml	2009-11-25 13:21:49 UTC (rev 30344)
+++ labs/jbosstm/trunk/build-release-pkgs.xml	2009-11-25 15:14:47 UTC (rev 30345)
@@ -66,7 +66,7 @@
     <property name="mvn.repositoryId" value="snapshots.jboss.org"/>
     <property name="mvn.url" value="dav:https://snapshots.jboss.org/maven2"/>
 -->
-    
+
     <!-- a working directory for the process. Can contain output from previous releases if you like to keep them archived locally. -->
     <property name="workdir" location="/tmp/packaged_builds"/>
     <!-- where to get the source -->
@@ -86,6 +86,12 @@
     <property name="mvn.repositoryId" value="repository.jboss.org"/>
     <property name="mvn.url" value="file:///${mvn.repodir}"/>
 
+    <taskdef resource="net/sf/antcontrib/antlib.xml">
+        <classpath>
+            <pathelement location="./antbuildsystem/ant-contrib-1.0b3.jar"/>
+        </classpath>
+    </taskdef>
+
     <target name="init">
         <tstamp/>
         <mkdir dir="${workdir}"/>
@@ -182,61 +188,85 @@
 
         <!-- 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"/>
 
         <!-- jta -->
 
-        <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"/>
+        <mvn-artifact.macro artifact="jbossjta" dir="${workdir}/build/${tag}/lib"/>
+        <mvn-artifact.macro artifact="jbossjta-integration" dir="${workdir}/build/${tag}/lib"/>
 
 
-
         <delete dir="${workdir}/build"/>
         <mkdir dir="${workdir}/build"/>
         <unzip src="${workdir}/jbossts-full-${filename}.zip" dest="${workdir}/build"/>
 
         <!-- jts -->
 
-        <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"/>
+        <mvn-artifact.macro artifact="jbossjts" dir="${workdir}/build/${tag}/lib"/>
+        <mvn-artifact.macro artifact="jbossjts-integration" dir="${workdir}/build/${tag}/lib"/>
 
         <!-- tools -->
 
         <mvn-artifact.macro artifact="jbossts-tools" packaging="sar"
-                            file="${workdir}/build/${tag}/bin/jbossts-tools.sar"/>
+                            dir="${workdir}/build/${tag}/bin"/>
 
         <!-- xts -->
 
         <mvn-artifact.macro artifact="jbossxts" packaging="sar"
-                            file="${workdir}/build/${tag}/xts/sar/jbossxts.sar"/>
+                            dir="${workdir}/build/${tag}/xts/sar"/>
         <mvn-artifact.macro artifact="jbossxts-tests" packaging="zip"
-                            file="${workdir}/build/${tag}/xts/tests/jbossxts-tests.zip"/>
+                            dir="${workdir}/build/${tag}/xts/tests"/>
         <mvn-artifact.macro artifact="jbossxts-interop-tests" packaging="zip"
-                            file="${workdir}/build/${tag}/xts/interop-tests/jbossxts-interop-tests.zip"/>
+                            dir="${workdir}/build/${tag}/xts/interop-tests"/>
 
+
+
+
+
+        
     </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="dir"/>
         <attribute name="packaging" default="jar"/>
 
         <sequential>
-            <copy  file="${workdir}/build/${tag}/maven/pom-template.xml"
+
+            <property name="groupid" value="jboss.jbossts"/>
+
+            <!-- where a -sources.jar exists, upload it first as we need the latter binary .jar to overwrite the
+                generated pom due to the requirement for working around http://jira.codehaus.org/browse/MDEPLOY-48
+                 which is also the same reason we need to mess around with uniqueVersion=false   /sigh. -->
+            <if>
+                <available file="@{dir}/@{artifact}-sources.jar"/>
+                <then>
+                    <exec executable="mvn" dir="${workdir}">
+                        <arg value="deploy:deploy-file"/>
+                        <arg value="-Dfile=@{dir}/@{artifact}-sources.jar"/>
+                        <arg value="-DrepositoryId=${mvn.repositoryId}"/>
+                        <arg value="-Durl=${mvn.url}"/>
+
+                        <arg value="-DgroupId=${groupid}"/>
+                        <arg value="-DartifactId=@{artifact}"/>
+                        <!--<arg value="-DgeneratePom=false"/> disable this due to MDEPLOY-48-->
+                        <arg value="-Dclassifier=sources"/>
+                        <arg value="-Dpackaging=java-source"/>
+                        <arg value="-Dversion=${filename}"/>
+                        <arg value="-DuniqueVersion=false"/>
+                    </exec>
+                </then>
+            </if>
+
+            <copy  file="${workdir}/${tag}/maven/pom-template.xml"
                    tofile="${workdir}/build/${tag}/pom-@{artifact}.xml"
                    filtering="true">
                 <filterset>
+                    <filter token="groupid" value="${groupid}"/>
                     <filter token="artifact" value="@{artifact}"/>
                     <filter token="version" value="${filename}"/>
                     <filter token="packaging" value="@{packaging}"/>
@@ -245,11 +275,13 @@
 
             <exec executable="mvn" dir="${workdir}">
                 <arg value="deploy:deploy-file"/>
-                <arg value="-Dfile=@{file}"/>
+                <arg value="-Dfile=@{dir}/@{artifact}.@{packaging}"/>
                 <arg value="-DrepositoryId=${mvn.repositoryId}"/>
                 <arg value="-Durl=${mvn.url}"/>
                 <arg value="-DpomFile=${workdir}/build/${tag}/pom-@{artifact}.xml"/>
+                <arg value="-DuniqueVersion=false"/>
             </exec>
+
         </sequential>
         
    </macrodef>

Modified: labs/jbosstm/trunk/maven/pom-template.xml
===================================================================
--- labs/jbosstm/trunk/maven/pom-template.xml	2009-11-25 13:21:49 UTC (rev 30344)
+++ labs/jbosstm/trunk/maven/pom-template.xml	2009-11-25 15:14:47 UTC (rev 30345)
@@ -23,7 +23,7 @@
 -->
 
     <modelVersion>4.0.0</modelVersion>
-    <groupId>jboss.jbossts</groupId>
+    <groupId>@groupid@</groupId>
     <artifactId>@artifact@</artifactId>
     <packaging>@packaging@</packaging>
     <version>@version@</version>

Modified: labs/jbosstm/trunk/sharedbuild.xml
===================================================================
--- labs/jbosstm/trunk/sharedbuild.xml	2009-11-25 13:21:49 UTC (rev 30344)
+++ labs/jbosstm/trunk/sharedbuild.xml	2009-11-25 15:14:47 UTC (rev 30345)
@@ -301,18 +301,18 @@
     <target name="install.src">
         <property name="component-module-list" value=""/>
 
-        <delete file="${build.dir}/lib/${modulename}-src.jar"/>
+        <delete file="${build.dir}/lib/${modulename}-sources.jar"/>
 
         <for list="${component-module-list}" param="module">
             <sequential>
-                <jar destfile="${build.dir}/lib/${modulename}-src.jar" update="true">
+                <jar destfile="${build.dir}/lib/${modulename}-sources.jar" update="true">
                     <fileset dir="@{module}/classes"/>
                 </jar>
                 
                 <if>
                     <available file="@{module}/${build.dir}/generatedclasses"/>
                     <then>
-                        <jar destfile="${build.dir}/lib/${modulename}-src.jar" update="true">
+                        <jar destfile="${build.dir}/lib/${modulename}-sources.jar" update="true">
                             <fileset dir="@{module}/${build.dir}/generatedclasses"/>
                         </jar>
                     </then>
@@ -320,6 +320,8 @@
 
             </sequential>
         </for>
+
+        <copy file="${build.dir}/lib/${modulename}-sources.jar" todir="${build.dir}/install/lib"/>
     </target>
 
     <macrodef name="htdocs.composite.macro">



More information about the jboss-svn-commits mailing list