You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by ps...@apache.org on 2011/10/17 15:41:48 UTC

svn commit: r1185167 - in /incubator/wookie/trunk: ant/ivy-java-common.xml ant/ivysettings.xml build.xml connector/java/ivy.xml parser/java/ivy.xml

Author: psharples
Date: Mon Oct 17 13:41:48 2011
New Revision: 1185167

URL: http://svn.apache.org/viewvc?rev=1185167&view=rev
Log:
Fix for sources & javadoc jar files not being added to the maven artifacts correctly. Also new ant task added to allow maven artifacts to be published to the central staging repo. See WOOKIE-269.

Modified:
    incubator/wookie/trunk/ant/ivy-java-common.xml
    incubator/wookie/trunk/ant/ivysettings.xml
    incubator/wookie/trunk/build.xml
    incubator/wookie/trunk/connector/java/ivy.xml
    incubator/wookie/trunk/parser/java/ivy.xml

Modified: incubator/wookie/trunk/ant/ivy-java-common.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/ant/ivy-java-common.xml?rev=1185167&r1=1185166&r2=1185167&view=diff
==============================================================================
--- incubator/wookie/trunk/ant/ivy-java-common.xml (original)
+++ incubator/wookie/trunk/ant/ivy-java-common.xml Mon Oct 17 13:41:48 2011
@@ -209,6 +209,12 @@
     	<delete dir="${dist.dir}/javadoc" />
     </target>
 	
+    <target name="test-calling-project">
+    	<condition property="not-subproject">
+    		<equals arg1="${ant.project.name}" arg2="wookie"/>
+    	</condition>
+    </target>	
+		
     <target name="publish" depends="clean-build, jar" description="--> publish this project in the ivy repository">
         <ivy:publish
     	   artifactspattern="[artifact].[ext]"
@@ -217,47 +223,30 @@
     	/>
         <echo message="project ${ant.project.name} released with version ${revision}" />
     </target>
+		
+	<!-- 
+	================================================================================
+	We have 3 tasks that are almost identical, except one parameter - the resolver
 	
-	<!--
-	Note to run this task, you must first add your credentials on the command line 
+	publish-local
+	publish-maven-snapshot-artifacts
+	publish-maven-release-artifacts
 	
-	i.e.
+	TODO - merge these into one task & pass the resolver as parameter
 	
-	 -Dupload.user=mysuername -Dupload.password=mypassword
+	Note to run either the...
+	 
+	'publish-maven-snapshot-artifacts' OR 
+	'publish-maven-release-artifacts'
 	 
+	...tasks, you must first add your credentials on the command line 
+	
+	i.e.
+	
+	 -Dupload.user=myusername -Dupload.password=mypassword
+	================================================================================
 	-->
-    <target name="publish-snapshots" depends="clean-dist, jar" description="--> publishes this project in the apache snapshot repository. Dont run this from the root, see instead 'snapshot-repo-publish-subprojects'">
-    	<echo>Locally publishing ${ant.project.name}-${version}</echo>
-    	<fail unless="upload.user" message="supply upload.user on the command line"/>
-    	<fail unless="upload.password" message="supply upload.password on the command line"/>
-    	<delete file="${dist.dir}/ivy.xml"/> <!-- delete last produced ivy file to be sure a new one will be generated -->
-    	<tstamp>
-    		<format property="now" pattern="yyyyMMddHHmmss"/>
-    	</tstamp>    	 
-    	<ivy:makepom ivyfile="${basedir}/ivy.xml"
-    	    		templatefile="${basedir}/pom-template.xml"
-    	    		pomfile="${dist.dir}/${ant.project.name}.pom">
-    		<mapping conf="deploy" scope="compile"/>
-    	</ivy:makepom>
 	
-    	<ivy:publish resolver="apache-snapshot"
-    	    		pubrevision="${version}"
-    	    		forcedeliver="true"
-    	    		publishivy="false"
-    	    		srcivypattern="${dist.dir}/ivy.xml"    	    		
-    				pubdate="${now}"
-    	    		overwrite="true">    	    		
-    				<artifacts pattern="${dist.dir}/[artifact](-[classifier]).[ext]"/>    	    		    		
-    	    	</ivy:publish>
-    	<echo message="project ${ant.project.name} published to nexus snapshot repo with version ${version}" />    	
-    </target>
-
-    <target name="test-calling-project">
-    	<condition property="not-subproject">
-    		<equals arg1="${ant.project.name}" arg2="wookie"/>
-    	</condition>
-    </target>
-
     <target name="publish-local" depends="test-calling-project, clean-dist, jar" unless="not-subproject" description="--> publish this project in the local ivy repository">
     	<echo>Locally publishing ${ant.project.name}-${version}</echo>
 		<delete file="${dist.dir}/ivy.xml"/> <!-- delete last produced ivy file to be sure a new one will be generated -->
@@ -275,12 +264,60 @@
     		forcedeliver="true"
     		publishivy="false"
     		srcivypattern="${dist.dir}/ivy.xml"
-			pubdate="${now}"
-    		overwrite="true">
-    		<!--<artifacts pattern="${dist.dir}/[artifact].[ext]"/>-->
-    		<artifacts pattern="${dist.dir}/[artifact](-[classifier]).[ext]"/>
-    	</ivy:publish>
+			pubdate="${now}"    		
+    		overwrite="true"    		    		
+    		artifactspattern="${dist.dir}/[artifact](-[classifier]).[ext]"/>    	
         <echo message="project ${ant.project.name} published locally with version ${version}" />
+    </target>	
+	
+    <target name="publish-maven-snapshot-artifacts" depends="clean-dist, jar" description="--> publishes this project in the apache snapshot repository. Dont run this from the root, see instead 'publish-subproject-artifacts-to-snapshot-repo'">
+    	<echo>Locally publishing ${ant.project.name}-${version}</echo>
+    	<fail unless="upload.user" message="supply upload.user on the command line"/>
+    	<fail unless="upload.password" message="supply upload.password on the command line"/>
+    	<delete file="${dist.dir}/ivy.xml"/> <!-- delete last produced ivy file to be sure a new one will be generated -->
+    	<tstamp>
+    		<format property="now" pattern="yyyyMMddHHmmss"/>
+    	</tstamp>    	 
+    	<ivy:makepom ivyfile="${basedir}/ivy.xml"
+    	    		templatefile="${basedir}/pom-template.xml"
+    	    		pomfile="${dist.dir}/${ant.project.name}.pom">
+    		<mapping conf="deploy" scope="compile"/>
+    	</ivy:makepom>
+	
+    	<ivy:publish resolver="apache-snapshot-artifacts"
+			pubrevision="${version}"
+			forcedeliver="true"
+			publishivy="false"
+			srcivypattern="${dist.dir}/ivy.xml"    	    		
+			pubdate="${now}"
+			overwrite="true"
+			artifactspattern="${dist.dir}/[artifact](-[classifier]).[ext]"/>    		    		    		    	    	
+    	<echo message="project ${ant.project.name} published to nexus snapshot repo with version ${version}" />    	
     </target>
 
+    <target name="publish-maven-release-artifacts" depends="clean-dist, jar" description="--> publishes this project in the apache staging area repository (prior to release). Dont run this from the root, see instead 'publish-subproject-artifacts-to-release-repo'">
+    	<echo>Locally publishing ${ant.project.name}-${version}</echo>
+    	<fail unless="upload.user" message="supply upload.user on the command line"/>
+    	<fail unless="upload.password" message="supply upload.password on the command line"/>
+    	<delete file="${dist.dir}/ivy.xml"/> <!-- delete last produced ivy file to be sure a new one will be generated -->
+    	<tstamp>
+    		<format property="now" pattern="yyyyMMddHHmmss"/>
+    	</tstamp>    	 
+    	<ivy:makepom ivyfile="${basedir}/ivy.xml"
+    	    		templatefile="${basedir}/pom-template.xml"
+    	    		pomfile="${dist.dir}/${ant.project.name}.pom">
+    		<mapping conf="deploy" scope="compile"/>
+    	</ivy:makepom>
+	
+    	<ivy:publish resolver="apache-release-artifacts"
+			pubrevision="${version}"
+			forcedeliver="true"
+			publishivy="false"
+			srcivypattern="${dist.dir}/ivy.xml"    	    		
+			pubdate="${now}"
+			overwrite="true"
+			artifactspattern="${dist.dir}/[artifact](-[classifier]).[ext]"/>    		    		    		    	    	
+    	<echo message="project ${ant.project.name} published to nexus snapshot repo with version ${version}" />    	
+    </target>	
+	
 </project>

Modified: incubator/wookie/trunk/ant/ivysettings.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/ant/ivysettings.xml?rev=1185167&r1=1185166&r2=1185167&view=diff
==============================================================================
--- incubator/wookie/trunk/ant/ivysettings.xml (original)
+++ incubator/wookie/trunk/ant/ivysettings.xml Mon Oct 17 13:41:48 2011
@@ -16,9 +16,10 @@
   limitations under the License.
 -->
 <ivysettings>
-  <property name="apache.repo.snapshot.url" value="https://repository.apache.org/content/repositories/snapshots/" override="false" />
+  <property name="apache.repo.release.url" value="https://repository.apache.org/service/local/staging/deploy/maven2" override="false" />  
+  <property name="apache.repo.snapshot.url" value="https://repository.apache.org/content/repositories/snapshots/" override="false" />  
   <credentials host="repository.apache.org" realm="Sonatype Nexus Repository Manager" username="${upload.user}" passwd="${upload.password}"/>
-  <property name="maven2.pattern" value="[organisation]/[module]/[revision]/[module]-[revision]" />
+  <property name="maven2.pattern" value="[organisation]/[module]/[revision]/[module]-[revision](-[classifier])" />
   <property name="maven2.pattern.ext" value="${maven2.pattern}.[ext]" />
   <settings defaultResolver="wookie-chain" />
   <caches>
@@ -39,7 +40,8 @@
 			<artifact pattern="${apache.repo.snapshot.url}/${maven2.pattern.ext}"/>
 		</url>
 		-->
-		<ibiblio name="apache-snapshot" root="${apache.repo.snapshot.url}" pattern="${maven2.pattern.ext}" m2compatible="true" />
+		<ibiblio name="apache-snapshot-artifacts" root="${apache.repo.snapshot.url}" pattern="${maven2.pattern.ext}" m2compatible="true" />
+		<ibiblio name="apache-release-artifacts" root="${apache.repo.release.url}" pattern="${maven2.pattern.ext}" m2compatible="true" />
 	  </chain>
   </resolvers>
 </ivysettings>

Modified: incubator/wookie/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/build.xml?rev=1185167&r1=1185166&r2=1185167&view=diff
==============================================================================
--- incubator/wookie/trunk/build.xml (original)
+++ incubator/wookie/trunk/build.xml Mon Oct 17 13:41:48 2011
@@ -236,11 +236,17 @@
   	<ant dir="${wookie.parser.w3c.dir}/java" target="publish-local" inheritAll="false"/>
   </target>
 	
-  <target name="snapshot-repo-publish-subprojects" description="Publishes all sub projects (i.e. java connector and parser projects) to the apache snapshot repository">
+  <target name="publish-subproject-artifacts-to-snapshot-repo" description="Publishes all sub projects (i.e. java connector and parser projects) to the apache snapshot repository">
 	<!-- publish snapshot sub-projects -->
-	<ant dir="${wookie.connector.dir}/java" target="publish-snapshots" inheritAll="false"/>
-	<ant dir="${wookie.parser.w3c.dir}/java" target="publish-snapshots" inheritAll="false"/>
+	<ant dir="${wookie.connector.dir}/java" target="publish-maven-snapshot-artifacts" inheritAll="false"/>
+	<ant dir="${wookie.parser.w3c.dir}/java" target="publish-maven-snapshot-artifacts" inheritAll="false"/>
   </target>	
+	
+  <target name="publish-subproject-artifacts-to-release-repo" description="Publishes all sub projects (i.e. java connector and parser projects) to the apache release repository">
+	<!-- publish staging/release sub-projects -->
+	<ant dir="${wookie.connector.dir}/java" target="publish-maven-release-artifacts" inheritAll="false"/>
+	<ant dir="${wookie.parser.w3c.dir}/java" target="publish-maven-release-artifacts" inheritAll="false"/>
+  </target>		
   	
   <target name="pre-compile-core">
     <!-- build supported database schema scripts -->

Modified: incubator/wookie/trunk/connector/java/ivy.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/connector/java/ivy.xml?rev=1185167&r1=1185166&r2=1185167&view=diff
==============================================================================
--- incubator/wookie/trunk/connector/java/ivy.xml (original)
+++ incubator/wookie/trunk/connector/java/ivy.xml Mon Oct 17 13:41:48 2011
@@ -22,19 +22,12 @@
 	  <conf name="dev" extends="deploy" description="Provide the necessary files and libraries to run in standalone (development) mode"/>
 	  <conf name="test" extends="dev" visibility="private" description="for our testing framework"/>
 	</configurations>
-	
-	
-	<publications xmlns:e="urn:ant.apache.org:ivy-extras">	
-	<!-- 
-	  Need to figure out why the publish task in ivy-java-common.xml does not pick up the source & javadoc jars
-	  Commented out for now as they appear to be copied over without the classifier added in which may
-	  cause the original compiled wookie-java-connector.jar to be overwritten
-	  	       
+		
+	<publications xmlns:e="urn:ant.apache.org:ivy-extras">		
+	  <artifact name="wookie-java-connector" type="pom" ext="pom" conf="deploy"/>
+      <artifact name="wookie-java-connector" type="jar" conf="deploy"/>	  	
       <artifact name="wookie-java-connector" type="sources" conf="deploy" ext="jar" e:classifier="sources"/>
-      <artifact name="wookie-java-connector" type="javadoc" conf="deploy" ext="jar" e:classifier="javadoc"/>
-       -->
-      <artifact name="wookie-java-connector" type="pom" ext="pom" conf="deploy"/>
-      <artifact name="wookie-java-connector" type="jar" conf="deploy"/>   
+      <artifact name="wookie-java-connector" type="javadoc" conf="deploy" ext="jar" e:classifier="javadoc"/>                
 	</publications>
     
     <dependencies>

Modified: incubator/wookie/trunk/parser/java/ivy.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/parser/java/ivy.xml?rev=1185167&r1=1185166&r2=1185167&view=diff
==============================================================================
--- incubator/wookie/trunk/parser/java/ivy.xml (original)
+++ incubator/wookie/trunk/parser/java/ivy.xml Mon Oct 17 13:41:48 2011
@@ -24,16 +24,10 @@
 	</configurations>
 	
 	<publications>      
-	  <!-- 
-	  Need to figure out why the publish task in ivy-java-common.xml does not pick up the source & javadoc jars
-	  Commented out for now as they appear to be copied over without the classifier added in which may
-	  cause the original compiled wookie-parser.jar to be overwritten
-	  	 
-      <artifact name="wookie-parser" type="sources" ext="jar" m:classifier="sources"/>
-      <artifact name="wookie-parser" type="javadoc" ext="jar" m:classifier="javadoc"/>
-       -->
-      <artifact name="wookie-parser" type="pom" ext="pom"/>
-      <artifact name="wookie-parser" type="jar"/>
+	  <artifact name="wookie-parser" conf="deploy" type="pom" ext="pom"/>
+      <artifact name="wookie-parser" conf="deploy" type="jar"/>
+      <artifact name="wookie-parser" conf="deploy" type="sources" ext="jar" m:classifier="sources"/>
+      <artifact name="wookie-parser" conf="deploy" type="javadoc" ext="jar" m:classifier="javadoc"/>            
 	</publications>
     
     <dependencies>