tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r586443 - in /tomcat/tc6.0.x/trunk/res/maven: mvn-pub.xml mvn.properties.default
Date Fri, 19 Oct 2007 13:35:19 GMT
Author: fhanik
Date: Fri Oct 19 06:35:18 2007
New Revision: 586443

URL: http://svn.apache.org/viewvc?rev=586443&view=rev
Log:
Add a ANT script that can sign and publish to the central ASF maven repo

Modified:
    tomcat/tc6.0.x/trunk/res/maven/mvn-pub.xml
    tomcat/tc6.0.x/trunk/res/maven/mvn.properties.default

Modified: tomcat/tc6.0.x/trunk/res/maven/mvn-pub.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/res/maven/mvn-pub.xml?rev=586443&r1=586442&r2=586443&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/res/maven/mvn-pub.xml (original)
+++ tomcat/tc6.0.x/trunk/res/maven/mvn-pub.xml Fri Oct 19 06:35:18 2007
@@ -15,9 +15,15 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<project name="Tomcat 6.0" default="deploy" basedir=".">
+<project name="Tomcat 6.0" default="" basedir="." xmlns:artifact="urn:maven-artifact-ant">
 
   <!--
+    Built for using Maven 2.0.4
+    Two additional jar files required, please download from
+    http://people.apache.org/~fhanik/tomcat/maven/
+    
+  -->
+  <!--
   Properties required to be set:
   maven.home - full path to Maven2 installation, mvn or mvn.bat is assumed to be in ${maven.home}/bin/
   maven.bin  - the script to execute for maven, would be mvn or mvn.bat
@@ -37,17 +43,62 @@
       <privateKey>/home/yourusername/.ssh/id_rsa</privateKey>
       <passphrase></passphrase>
     </server>
+    
+  To get a private key to work on Windows, I followed these steps
+  1. on a linux box execute 'ssh-keygen -t rsa'
+  2. same linux box execute 'cat id_rsa.pub >> authorized_keys' and 'cat id_rsa.pub
>> authorized_keys2'
+  3. Copy id_rsa and id_rsa.pub to my windows box
+  4. Import id_rsa into puttygen
+  5. export id_rsa from puttygen to OpenSSH key
+  6. The key you exported from puttygen is the one you reference from the <privateKey>
element
+  7. Manually create the %USERPROFILE%\.ssh directory
+  8. Manually add the %USERPROFILE%\.ssh\known_hosts file with the entry for the host
   -->
   <property file="${basedir}/mvn.properties"/>
   <property file="${basedir}/mvn.properties.default"/>
+  <property name="local.repo" value="${user.home}/.m2/repository"/>
   
-  <target name="maven-deploy">
+  <target name="init-maven">
+    <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant">
+      <classpath>
+        <pathelement location="${basedir}/maven-ant-tasks-attached-patch.jar" />
+        <pathelement location="${basedir}/maven-artifact-ant-2.0.4-dep.jar" />
+      </classpath>
+    </typedef>
+    <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/>
+  </target>
+
+  <target name="maven-deploy" depends="init-maven">
+    <!--cleanup-->
+    <delete file="${pom}.tmp"/>
+    <delete file="${file}.asc"/>
+
     <!--replace the version in the pom-->
     <copy file="${pom}" tofile="${pom}.tmp">
       <filterset>
         <filter token="MAVEN.DEPLOY.VERSION" value="${maven.deploy.version}"/>
       </filterset>
     </copy>
+    
+    <!--sign the jar-->
+    <exec executable="${maven.gpg.exec}" failonerror="true" inputstring="${maven.gpg.passphrase}">
+      <arg value="--passphrase-fd"/>
+      <arg value="0"/>
+      <arg value="-a"/>
+      <arg value="-b"/>
+      <arg value="${file}"/>
+    </exec>
+    
+    <!--deploy it-->
+    <artifact:deploy file="${file}">
+        <pom file="${pom}.tmp"/>
+        <remoteRepository url="${maven.repo.url}" layout="default">
+          <authentication username="${maven.scp.username}" privateKey="${maven.scp.privateKey}"
passphrase="${maven.scp.passphrase}"/>
+        </remoteRepository>
+        <attach file="${file}.asc" type="jar.asc"/>
+    </artifact:deploy>
+
+    <!--
     <exec executable="${maven.home}/bin/${maven.bin}" failonerror="true">
       <env key="MAVEN_HOME" value="${maven.home}"/>
       <arg value="deploy:deploy-file"/>
@@ -61,10 +112,12 @@
       <arg value="-Durl=${maven.repo.url}"/>
       <arg value="-DpomFile=${pom}.tmp"/>
     </exec>
+    -->
     <delete file="${pom}.tmp"/>
+    <delete file="${file}.asc"/>
   </target>
   
-  <target name="generic-deploy">
+  <target name="generic-deploy" depends="init-maven">
     <antcall target="maven-deploy"><!--Deploy annotations-->
       <param name="file" value="${tomcat.lib.path}/annotations-api.jar"/>
       <param name="groupId" value="org.apache.tomcat"/>
@@ -137,6 +190,12 @@
       <param name="artifactId" value="jasper"/>
       <param name="pom" value="${tomcat.pom.path}/jasper.pom"/>
     </antcall>
+    <antcall target="maven-deploy"><!--Deploy DBCP-->
+      <param name="file" value="${tomcat.lib.path}/tomcat-dbcp.jar"/>
+      <param name="groupId" value="org.apache.tomcat"/>
+      <param name="artifactId" value="dbcp"/>
+      <param name="pom" value="${tomcat.pom.path}/dbcp.pom"/>
+    </antcall>
     <antcall target="maven-deploy"><!--Deploy Extras Juli-->
       <param name="file" value="${tomcat.extras.path}/tomcat-juli.jar"/>
       <param name="groupId" value="org.apache.tomcat.extras"/>
@@ -173,6 +232,10 @@
       <param name="maven.repo.url" value="${maven.asf.release.repo.url}"/>
       <param name="maven.deploy.version" value="${maven.asf.release.deploy.version}"/>
     </antcall>
+  </target>
+  
+  <target name="help">
+    <echo>Help is on the way!</echo>
   </target>
 
 </project>

Modified: tomcat/tc6.0.x/trunk/res/maven/mvn.properties.default
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/res/maven/mvn.properties.default?rev=586443&r1=586442&r2=586443&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/res/maven/mvn.properties.default (original)
+++ tomcat/tc6.0.x/trunk/res/maven/mvn.properties.default Fri Oct 19 06:35:18 2007
@@ -12,26 +12,39 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+# 
+# To create custom properties, simply create
+# the file mvn.properties
+# in this directory
+# no need to change this file
+#
 
 #Maven properties
+maven.scp.username=fhanik
+maven.scp.privateKey=${user.home}/.ssh/id_rsa.export
+maven.scp.passphrase=
+maven.gpg.exec=C:/software/GNU/GnuPG/gpg.exe
+maven.gpg.passphrase=*****
+
+
 maven.home=/development/maven-2.0.4
 #Define mvn for Unix systems and mvn.bat for Windows as ANT exec requires the full name
-maven.bin=mvn
+maven.bin=mvn.bat
 
 #Maven snapshot properties
 maven.snapshot.repo.url=scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository
 maven.snapshot.repo.repositoryId=apache.snapshots
-maven.snapshot.deploy.version=6.0.X-SNAPSHOT
+maven.snapshot.deploy.version=6.T.X-SNAPSHOT
 
 #Maven release properties for Tomcat staging
 maven.release.repo.url=scp://people.apache.org/www/tomcat.apache.org/dev/dist/m2-repository
 maven.release.repo.repositoryId=tomcat-staging
-maven.release.deploy.version=6.0.8
+maven.release.deploy.version=6.T.X
 
 #Maven release properties for the main ASF repo
 maven.asf.release.repo.url=scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository
 maven.asf.release.repo.repositoryId=apache.releases
-maven.asf.release.deploy.version=6.0.8
+maven.asf.release.deploy.version=6.T.T
 
 
 #Where do we load the libraries from



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message