You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2016/04/15 13:06:58 UTC

svn commit: r1739281 - /poi/trunk/build.xml

Author: kiwiwings
Date: Fri Apr 15 11:06:58 2016
New Revision: 1739281

URL: http://svn.apache.org/viewvc?rev=1739281&view=rev
Log:
Nexus upload - mimic the manually uploaded repositories - see [INFRA-11687]

Modified:
    poi/trunk/build.xml

Modified: poi/trunk/build.xml
URL: http://svn.apache.org/viewvc/poi/trunk/build.xml?rev=1739281&r1=1739280&r2=1739281&view=diff
==============================================================================
--- poi/trunk/build.xml (original)
+++ poi/trunk/build.xml Fri Apr 15 11:06:58 2016
@@ -1985,18 +1985,76 @@ under the License.
         </openpgp:signer>
     </target>
 
+    <target name="dist-nexus" depends="load-maven-server-settings,dist-checksum">
+        <delete dir="build/repo"/>
+        <delete dir="build/nexus-stage"/>
+        <nexus-upload artifactId="poi"/>
+        <nexus-upload artifactId="poi-examples"/>
+        <nexus-upload artifactId="poi-excelant"/>
+        <nexus-upload artifactId="poi-ooxml"/>
+        <nexus-upload artifactId="poi-ooxml-schemas"/>
+        <nexus-upload artifactId="poi-scratchpad"/>
+    </target>
+
     <macrodef name="nexus-upload">
         <attribute name="artifactId"/>
         <sequential>
+            <local name="repo"/>
+            <property name="repo" location="build/repo/@{artifactId}"/>
+
+            <copy todir="${repo}">
+                <mappedresources>
+                    <fileset dir="build/dist/maven" includes="@{artifactId}/**"/>
+                    <regexpmapper from="^([^/]+)/(.*)$$" to="org/apache/poi/\1/${version.id}/\2" handledirsep="true"/>
+                </mappedresources>
+            </copy>
+
+            <local name="lastUpdated"/>
+            <tstamp>
+                <format property="lastUpdated" pattern="yyyyMMddHHmmss" timezone="UTC"/>
+            </tstamp>            
+
+            <local name="metadir"/>
+            <property name="metadir" location="${repo}/org/apache/poi/@{artifactId}"/>
+
+            <echo file="${metadir}/maven-metadata.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+  <groupId>org.apache.poi</groupId>
+  <artifactId>@{artifactId}</artifactId>
+  <versioning>
+    <latest>${version.id}</latest>
+    <release>${version.id}</release>
+    <versions>
+      <version>${version.id}</version>
+    </versions>
+    <lastUpdated>${lastUpdated}</lastUpdated>
+  </versioning>
+</metadata>]]></echo>
+            <fixcrlf srcdir="${metadir}" includes="maven-metadata.xml" eol="unix" eof="remove" />
+            <checksum algorithm="sha1" format="MD5SUM">
+                <fileset dir="${metadir}" includes="maven-metadata.xml"/>
+            </checksum>
+            <checksum algorithm="md5" format="MD5SUM">
+                <fileset dir="${metadir}" includes="maven-metadata.xml"/>
+            </checksum>
+
+            <fixcrlf srcDir="${metadir}" includes="*.md5,*.sha1" eol="unix"/>
+
             <downloadfile src="${dist.nexus-staging.url}" dest="${dist.nexus-staging.jar}"/>
             <taskdef uri="antlib:org.sonatype.nexus.ant.staging" resource="org/sonatype/nexus/ant/staging/antlib.xml">
                 <classpath><pathelement path="${dist.nexus-staging.jar}"/></classpath>
             </taskdef>
 
-            <staging:stageRemotely keepStagingRepositoryOnFailure="true" description="@{artifactId} ${version.id}">
-                <staging:nexusStagingInfo stagingDirectory="build/dist/maven/@{artifactId}">
+            <staging:stageLocally description="@{artifactId} ${version.id}">
+                <staging:nexusStagingInfo stagingDirectory="build/nexus-stage/@{artifactId}"/>
+                <fileset dir="${repo}" />
+            </staging:stageLocally>
+
+            <!-- if this throws a "... dh keypair ..." exception, use Java 7+ for executing the task -->
+            <staging:stageRemotely description="@{artifactId} ${version.id}">
+                <staging:nexusStagingInfo stagingDirectory="build/nexus-stage/@{artifactId}">
                     <staging:projectInfo groupId="org.apache.poi" artifactId="@{artifactId}" version="${version.id}" />
-                    <staging:connectionInfo baseUrl="https://repository.apache.org">
+                    <staging:connectionInfo baseUrl="https://repository.apache.org/">
                         <staging:authentication username="${settings.apache-id.username}" password="${settings.apache-id.password}" />
                     </staging:connectionInfo>
                 </staging:nexusStagingInfo>
@@ -2004,16 +2062,6 @@ under the License.
         </sequential>
     </macrodef>
 
-    <target name="dist-nexus" depends="load-maven-server-settings,dist-checksum">
-        <!-- if this throws a "... dh keypair ..." exception, use Java 7+ for executing the task -->
-        <nexus-upload artifactId="poi"/>
-        <nexus-upload artifactId="poi-examples"/>
-        <nexus-upload artifactId="poi-excelant"/>
-        <nexus-upload artifactId="poi-ooxml"/>
-        <nexus-upload artifactId="poi-ooxml-schemas"/>
-        <nexus-upload artifactId="poi-scratchpad"/>
-    </target>
-
     <target name="-init-svn" depends="init,fetch-svn-jars,load-maven-server-settings">
         <!-- JAVA_HOME needs to point to a JRE/JDK7+, otherwise the svn/https connection throws a "Could not generate DH keypair"-->
         <fail message="Environment needs to point to a java 7+">



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org