You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by nb...@apache.org on 2008/10/27 20:45:30 UTC

svn commit: r708300 - in /velocity/engine/trunk: build/build.properties build/build.xml build/download.xml pom.xml src/changes/changes.xml

Author: nbubna
Date: Mon Oct 27 12:45:30 2008
New Revision: 708300

URL: http://svn.apache.org/viewvc?rev=708300&view=rev
Log:
VELOCITY-466 and VELOCITY-554 add maven-ant tasks for install and deploying and include source and javadoc jars (thx to Adrian Tarau)

Modified:
    velocity/engine/trunk/build/build.properties
    velocity/engine/trunk/build/build.xml
    velocity/engine/trunk/build/download.xml
    velocity/engine/trunk/pom.xml
    velocity/engine/trunk/src/changes/changes.xml

Modified: velocity/engine/trunk/build/build.properties
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/build/build.properties?rev=708300&r1=708299&r2=708300&view=diff
==============================================================================
--- velocity/engine/trunk/build/build.properties (original)
+++ velocity/engine/trunk/build/build.properties Mon Oct 27 12:45:30 2008
@@ -22,7 +22,7 @@
 # Global defaults
 name=       Velocity
 project=    velocity
-version=    1.6-beta2
+version=    1.6-dev
 final.name= ${project}-${version}
 
 # compile switches
@@ -115,7 +115,7 @@
 
 #
 # We download directly from the ibiblio maven repository
-repo.url= http://www.ibiblio.org/maven
+repo.m1.url= http://www.ibiblio.org/maven
 repo.m2.url=http://www.ibiblio.org/maven2
 #
 # Jars to be downloaded
@@ -136,6 +136,14 @@
 jar.maven.ant.version=2.0.9
 
 ########################################################################
+# Maven settings
+maven.pom=${velocity.dir}/pom.xml
+maven.build.dir= ${build.dir}/maven
+wagon-ssh.version=1.0-beta-2
+# POM distributionManagement is used if this is not set
+#maven.remote.repository=
+
+########################################################################
 # Gump wants to override these names, so make
 # it configurable...
 #

Modified: velocity/engine/trunk/build/build.xml
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/build/build.xml?rev=708300&r1=708299&r2=708300&view=diff
==============================================================================
--- velocity/engine/trunk/build/build.xml (original)
+++ velocity/engine/trunk/build/build.xml Mon Oct 27 12:45:30 2008
@@ -28,7 +28,7 @@
 <!-- the ant based build and the maven based build.           -->
 <!-- *** DO NOT CHANGE THIS SETTING LIGHTLY! ***              -->
 
-<project name="Velocity" default="world" basedir="..">
+<project name="Velocity" default="world" basedir=".." xmlns:artifact="urn:maven-artifact-ant">
 
   <path id="basedir-os">
     <pathelement location="${basedir}" />
@@ -425,7 +425,7 @@
   <!-- =================================================================== -->
   <target name="jar-dep" depends="compile-src,build-dependency-classes"
           description="Builds the Velocity Jar file including all dependencies">
-    <property name="jarname" value="${project}-dep-${version}" />
+    <property name="jarname" value="${project}-${version}-dep" />
     <antcall target="build-jar" />
   </target>
 
@@ -574,6 +574,24 @@
       <link href="http://jakarta.apache.org/commons/lang/api-release"/>
       <link href="http://jakarta.apache.org/commons/collections/api-release"/>
     </javadoc>
+
+    <jar jarfile="${build.dir}/${final.name}-javadoc.jar">
+      <fileset dir="${build.javadoc}"/>
+      <manifest>
+        <attribute name="Created-By" value="Apache Ant"/>
+        <attribute name="Specification-Title" value="Velocity is a Java-based template engine" />
+        <attribute name="Specification-Vendor" value="Apache Software Foundation"/>
+        <attribute name="Implementation-Title" value="org.apache.velocity"/>
+        <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
+        <attribute name="Implementation-Vendor-Id" value="org.apache"/>
+        <attribute name="Implementation-Version" value="${version}"/>
+      </manifest>
+    </jar>
+
+    <checksum file="${build.dir}/${final.name}-javadoc.jar" algorithm="md5" property="checksum.jar-javadoc.md5"/>
+    <checksum file="${build.dir}/${final.name}-javadoc.jar" algorithm="sha1" property="checksum.jar-javadoc.sha1"/>
+    <echo message="${checksum.jar-javadoc.md5} *${final.name}-javadoc.jar" file="${build.dir}/${final.name}-javadoc.jar.md5" />
+    <echo message="${checksum.jar-javadoc.sha1} *${final.name}-javadoc.jar" file="${build.dir}/${final.name}-javadoc.jar.sha1" />
   </target>
 
   <target name="javadocs-clean">
@@ -581,7 +599,7 @@
   </target>
 
   <!-- =================================================================== -->
-  <!-- Prepares the Maven POM file                                         -->
+  <!-- Prepares the Maven POM file for "release" target                    -->
   <!-- =================================================================== -->
   <target name="pom" description="Gets the POM ready to be distributed">
     <!-- Create a distribution ready POM -->
@@ -593,6 +611,77 @@
   </target>
 
   <!-- =================================================================== -->
+  <!-- Prepare Maven environment                                           -->
+  <!-- =================================================================== -->
+
+  <target name="maven-prepare">
+    <ant antfile="${velocity.build.dir}/download.xml" target="build-download" />
+
+    <path id="maven-ant-tasks.classpath" path="${build.lib}/maven-ant-tasks-${jar.maven.ant.version}.jar"/>
+    <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
+               uri="urn:maven-artifact-ant"
+               classpathref="maven-ant-tasks.classpath"/>
+
+    <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/>
+
+    <artifact:pom file="${maven.pom}" id="maven.project"/>
+  </target>
+
+  <!-- =================================================================== -->
+  <!-- Install Maven artifacts                                             -->
+  <!-- =================================================================== -->
+  <target name="maven-install" depends="maven-prepare,release" 
+    description="Installs the Maven artifacts in local repository">
+
+    <artifact:install file="${build.dir}/${project}-${version}.jar" >
+      <pom refid="maven.project"/>
+      <attach file="${build.dir}/${project}-${version}-src.jar" type="jar" classifier="sources"/>
+      <attach file="${build.dir}/${project}-${version}-dep.jar" type="jar" classifier="dep"/>
+      <attach file="${build.dir}/${project}-${version}-javadoc.jar" type="jar" classifier="javadoc"/>
+    </artifact:install>
+  </target>
+
+  <!-- =================================================================== -->
+  <!-- Deploy Maven artifacts  - custom repository                        -->
+  <!-- =================================================================== -->
+  <target name="maven-deploy-custom-repository" if="maven.remote.repository"
+    description="Deploys the Maven artifacts in local repository">
+
+    <echo>Deploying to ${maven.remote.repository}</echo>
+
+    <artifact:deploy file="${build.dir}/${project}-${version}.jar" >
+        <remoteRepository id="velocity.custom.repository" url="${maven.remote.repository}"/>
+        <pom refid="maven.project"/>
+        <attach file="${build.dir}/${project}-${version}-src.jar" type="jar" classifier="sources"/>
+        <attach file="${build.dir}/${project}-${version}-dep.jar" type="jar" classifier="dep"/>
+        <attach file="${build.dir}/${project}-${version}-javadoc.jar" type="jar" classifier="javadoc"/>
+    </artifact:deploy>
+  </target>
+
+  <!-- =================================================================== -->
+  <!-- Deploy Maven artifacts - Apache Maven repository                   -->
+  <!-- =================================================================== -->
+  <target name="maven-deploy-apache-repository" unless="maven.remote.repository"
+    description="Deploys the Maven artifacts in apache repository">
+
+    <echo>Deploying to Apache Maven repository</echo>
+
+    <artifact:install-provider artifactId="wagon-ssh" version="${wagon-ssh.version}"/>
+
+    <artifact:deploy file="${build.dir}/${project}-${version}.jar" >
+        <pom refid="maven.project"/>
+        <attach file="${build.dir}/${project}-${version}-src.jar" type="jar" classifier="sources"/>
+        <attach file="${build.dir}/${project}-${version}-dep.jar" type="jar" classifier="dep"/>
+        <attach file="${build.dir}/${project}-${version}-javadoc.jar" type="jar" classifier="javadoc"/>
+    </artifact:deploy>
+  </target>
+
+  <target name="maven-deploy"
+    depends="maven-prepare,release,maven-deploy-custom-repository,maven-deploy-apache-repository" unless="maven.remote.repository"
+    description="Deployes the Maven artifacts in local repository or apache repository">
+  </target>
+
+  <!-- =================================================================== -->
   <!-- Package                                                             -->
   <!-- =================================================================== -->
   <target name="build-package-tree" depends="clean">
@@ -608,6 +697,7 @@
     -->
     <antcall target="jar" />
     <antcall target="jar-dep" />
+    <antcall target="jar-src" />
     <antcall target="docs" />
     <antcall target="javadocs" />
 
@@ -705,8 +795,8 @@
     />
 
     <copy
-      file="${build.dir}/${project}-dep-${version}.jar"
-      tofile="${dist.dir}/${project}-dep-${version}.jar"
+      file="${build.dir}/${project}-${version}-dep.jar"
+      tofile="${dist.dir}/${project}-${version}-dep.jar"
     />
   </target>
 
@@ -895,7 +985,9 @@
         <available file="${build.dir}/${final.name}.zip.asc"/>
         <available file="${build.dir}/${final.name}.jar.asc"/>
         <available file="${build.dir}/${final.name}.pom.asc"/>
-        <available file="${build.dir}/${project}-dep-${version}.jar.asc"/>
+        <available file="${build.dir}/${project}-${version}-dep.jar.asc"/>
+        <available file="${build.dir}/${final.name}-src.jar.asc"/>
+        <available file="${build.dir}/${final.name}-javadoc.jar.asc"/>
       </and>
     </condition>
   </target>
@@ -992,7 +1084,7 @@
 
     * Once the release vote has passed, these files should all be copied to
         /www/www.apache.org/dist/velocity/engine/${version}
-      and the full jar, pom and their md5 and sha1 files should be copied into 
+      and the non-dep jar, source jar, javadoc jar, pom and respective md5, sha1 and asc files should be copied into 
         /www/people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/velocity/velocity/${version}/
 
     * Tag the release in SVN with a command such as:

Modified: velocity/engine/trunk/build/download.xml
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/build/download.xml?rev=708300&r1=708299&r2=708300&view=diff
==============================================================================
--- velocity/engine/trunk/build/download.xml (original)
+++ velocity/engine/trunk/build/download.xml Mon Oct 27 12:45:30 2008
@@ -62,7 +62,7 @@
 
   <target name="do-http-m1-download" unless="skip-download">
     <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"/>
-    <get src="${repo.url}/${download.groupId}/jars/${download.artifactId}-${download.version}.jar"
+    <get src="${repo.m1.url}/${download.groupId}/jars/${download.artifactId}-${download.version}.jar"
          dest="${build.lib}/${download.artifactId}-${download.version}.jar"
          usetimestamp="true"
          verbose="false"
@@ -84,7 +84,7 @@
 
   <target name="do-http-test-m1-download" unless="skip-download">
     <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"/>
-    <get src="${repo.url}/${download.groupId}/jars/${download.artifactId}-${download.version}.jar"
+    <get src="${repo.m1.url}/${download.groupId}/jars/${download.artifactId}-${download.version}.jar"
          dest="${build.test.lib}/${download.artifactId}-${download.version}.jar"
          usetimestamp="true"
          verbose="false"

Modified: velocity/engine/trunk/pom.xml
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/pom.xml?rev=708300&r1=708299&r2=708300&view=diff
==============================================================================
--- velocity/engine/trunk/pom.xml (original)
+++ velocity/engine/trunk/pom.xml Mon Oct 27 12:45:30 2008
@@ -33,7 +33,7 @@
 
   <groupId>org.apache.velocity</groupId>
   <artifactId>velocity</artifactId>
-  <version>1.6-beta2</version>
+  <version>1.6-dev</version>
 
   <name>Apache Velocity</name>
   <url>http://velocity.apache.org/engine/devel/</url>

Modified: velocity/engine/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/changes/changes.xml?rev=708300&r1=708299&r2=708300&view=diff
==============================================================================
--- velocity/engine/trunk/src/changes/changes.xml (original)
+++ velocity/engine/trunk/src/changes/changes.xml Mon Oct 27 12:45:30 2008
@@ -27,6 +27,11 @@
   <body>
     <release version="1.6" date="In Subversion">
 
+      <action type="add" dev="nbubna" issue="VELOCITY-466" due-to="Adrian Tarau">
+          Add Maven-Ant tasks for installing and deploying Maven artifacts, including
+          previously missing source and javadoc jars (VELOCITY-554).
+      </action>
+
     </release>
 
     <release version="1.6-beta2" date="2008-10-26">