[Yanel-commits] rev 45303 - public/yanel/trunk/src/build/resource-types

guillaume at wyona.com guillaume at wyona.com
Wed Nov 4 15:44:02 CET 2009


Author: guillaume
Date: 2009-11-04 15:44:02 +0100 (Wed, 04 Nov 2009)
New Revision: 45303

Modified:
   public/yanel/trunk/src/build/resource-types/resource-type.build.xml
Log:
Added 'maven:deploy-jar' target inspired by Wyona Commons's 'deploy-jar' one.
Also refactored code a bit to use Ant properties consistently for build paths.

Issue: 6967


Modified: public/yanel/trunk/src/build/resource-types/resource-type.build.xml
===================================================================
--- public/yanel/trunk/src/build/resource-types/resource-type.build.xml	2009-11-04 13:50:50 UTC (rev 45302)
+++ public/yanel/trunk/src/build/resource-types/resource-type.build.xml	2009-11-04 14:44:02 UTC (rev 45303)
@@ -135,7 +135,7 @@
     <jar destfile="${resource.lib.dir}/yanel-resource-${resource.name}-${resource.version}.jar"
       basedir="${resource.classes.dir}"
     />
-    <available property="resource.install.needed" file="src/build/pom.xml"/>
+    <available property="resource.install.needed" file="${resource.home.dir}/src/build/pom.xml"/>
     <antcall target="install-jar"/>
   </target>
 
@@ -152,12 +152,12 @@
 
   <!-- Place jar file for this resource into local maven repository -->
   <target name="install-jar" if="resource.install.needed">
-    <copy file="src/build/pom.xml" tofile="build/lib/pom.xml"/>
+    <copy file="${resource.home.dir}/src/build/pom.xml" tofile="${resource.lib.dir}/pom.xml"/>
 
-    <replace file="build/lib/pom.xml" value="${resource.version}">
+    <replace file="${resource.lib.dir}/pom.xml" value="${resource.version}">
       <replacetoken>@VERSION@</replacetoken>
     </replace>
-    <replace file="build/lib/pom.xml" value="${resource.name}">
+    <replace file="${resource.lib.dir}/pom.xml" value="${resource.name}">
       <replacetoken>@NAME@</replacetoken>
     </replace>
 
@@ -165,13 +165,37 @@
       basedir="${resource.java.dir}"
     />
 
-    <artifact:pom id="maven.project.core" file="build/lib/pom.xml"/>
-    <artifact:install file="build/lib/yanel-resource-${resource.name}-${resource.version}.jar">
+    <artifact:pom id="maven.project.core" file="${resource.lib.dir}/pom.xml"/>
+    <artifact:install file="${resource.lib.dir}/yanel-resource-${resource.name}-${resource.version}.jar">
       <pom refid="maven.project.core"/>
-      <attach file="build/lib/yanel-resource-${resource.name}-${resource.version}-sources.jar" classifier="sources"/>
+      <attach file="${resource.lib.dir}/yanel-resource-${resource.name}-${resource.version}-sources.jar" classifier="sources"/>
     </artifact:install>
   </target>
 
+  <target
+   description="Place jar file for this resource (and its associated sources jar file) into remote maven repository"
+   name="maven:deploy-jar" depends="init">
+    <property name="repository.url" value="scp://maven2.wyona.org/home/wyona/data1/data1/src/realms/maven2/data"/>
+    <property name="wyona.maven.repository.url" value="${repository.url}"/>
+    <property name="repository.username" value="wyona"/>
+    <property name="wyona.maven.repository.username" value="${repository.username}"/>
+
+    <!-- <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/> -->
+    <artifact:install-provider artifactId="wagon-ssh" version="1.0-alpha-7"/>
+
+    <echo>Deploying to ${wyona.maven.repository.url}...</echo>
+
+    <artifact:pom id="maven.project.core" file="${resource.lib.dir}/pom.xml"/>
+
+    <artifact:deploy file="${resource.lib.dir}/yanel-resource-${resource.name}-${resource.version}.jar">
+      <remoteRepository url="${wyona.maven.repository.url}">
+        <authentication username="${wyona.maven.repository.username}" privateKey="${user.home}/.ssh/id_dsa"/>
+      </remoteRepository>
+      <pom refid="maven.project.core"/>
+      <attach file="${resource.lib.dir}/yanel-resource-${resource.name}-${resource.version}-sources.jar" classifier="sources"/>
+    </artifact:deploy>
+  </target>
+
   <!-- Deploy jar file for this resource into local webapp libs directory -->
   <target name="deploy-jar" depends="compile">
     <copy todir="${tomcat1.home.dir}/webapps/${servlet.context.prefix}/WEB-INF/lib" file="${resource.lib.dir}/yanel-resource-${resource.name}-${resource.version}.jar">



More information about the Yanel-commits mailing list