You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by se...@apache.org on 2012/01/18 22:20:58 UTC

svn commit: r1233070 - /jmeter/trunk/res/maven/build.xml

Author: sebb
Date: Wed Jan 18 21:20:58 2012
New Revision: 1233070

URL: http://svn.apache.org/viewvc?rev=1233070&view=rev
Log:
Initial version of Ant script to deploy jars to Nexus

Added:
    jmeter/trunk/res/maven/build.xml   (with props)

Added: jmeter/trunk/res/maven/build.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/res/maven/build.xml?rev=1233070&view=auto
==============================================================================
--- jmeter/trunk/res/maven/build.xml (added)
+++ jmeter/trunk/res/maven/build.xml Wed Jan 18 21:20:58 2012
@@ -0,0 +1,155 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   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.
+-->
+<project name="JMeter" default="default" basedir=".">
+    <description>
+        Initial version of Ant script to deploy jars using Nexus.
+        By default, deploys the jars to target/deploy under JMeter home.
+        The environment variable MAVEN_HOME must point to a suitable Maven installation (2.2.1+)
+
+        For remote deployment, username/password will need to be set up in the appropriate
+        "server" entries in the Maven settings.xml file:
+        
+        apache.snapshots.https
+        apache.releases.https
+        
+        TODO: Does not currently handle source or javadoc jars.
+        
+        May be moved to home directory and/or merged into main build file.
+        
+        Usage:
+        
+        ant -Dmaven.deploy.version=2.6-SNAPSHOT [-DrepoType=snapshots]
+        
+        ant -Dmaven.deploy.version=2.6  [-DrepoType=releases]
+    </description>
+
+    <!-- Configuration items -->
+    
+    <!-- Top-level JMeter directory -->
+    <property name="home.dir" value="../.."/>
+    
+    <!-- Location of prototype POMs -->
+    <property name="pom.dir" value="${home.dir}/res/maven"/>
+    
+    
+    <property environment="env"/>
+    <property name="maven.home" value="${env.MAVEN_HOME}"/>
+
+
+    <!-- Directory where the 3rd party libraries (and jorphan) live -->
+    <property name="lib.dir" value="${home.dir}/lib"/>
+    
+    <!-- Where the build result .jars will be placed -->
+    <property name="dest.jar" value="${lib.dir}/ext"/>
+    
+    <!-- JMeter main jar -->
+    <property name="dest.jar.jmeter" value="${home.dir}/bin"/>
+
+    <property name="deploy.jars" value="true"/>
+    <property name="deploy.sources" value="false"/>
+    <property name="deploy.javadoc" value="false"/>
+    <property name="maven.deploy.version" value="2.6-SNAPSHOT"/>
+
+    <!-- Apache Nexus snapshots repo url -->
+    <property name="file.url" value="file:${home.dir}/target/deploy"/>
+
+    <!-- Apache Nexus snapshots repo url -->
+    <property name="snapshots.url" value="https://repository.apache.org/content/repositories/snapshots"/>
+    <!-- Apache Nexus snapshots repo name for servers section of settings.xml -->
+    <property name="snapshots.repositoryId" value="apache.snapshots.https"/>
+
+    <!-- Apache Nexus releases repo url -->
+    <property name="releases.url" value="https://repository.apache.org/service/local/staging/deploy/maven2"/>
+    <!-- Apache Nexus releases repo name for servers section of settings.xml -->
+    <property name="releases.repositoryId" value="apache.releases.https"/>
+
+    <property name="repoType" value="file"/>
+
+    <target name="default">
+        <deployfile stem="ApacheJMeter_parent"     dir="${pom.dir}" packaging="pom"/>
+
+        <deployfile stem="jorphan"                 dir="${lib.dir}"/>
+        <deployfile stem="ApacheJMeter"            dir="${dest.jar.jmeter}"/>
+        <deployfile stem="ApacheJMeter_components" dir="${dest.jar}"/>
+        <deployfile stem="ApacheJMeter_core"       dir="${dest.jar}"/>
+        <deployfile stem="ApacheJMeter_ftp"        dir="${dest.jar}"/>
+        <deployfile stem="ApacheJMeter_functions"  dir="${dest.jar}"/>
+        <deployfile stem="ApacheJMeter_http"       dir="${dest.jar}"/>
+        <deployfile stem="ApacheJMeter_java"       dir="${dest.jar}"/>
+        <deployfile stem="ApacheJMeter_jdbc"       dir="${dest.jar}"/>
+        <deployfile stem="ApacheJMeter_jms"        dir="${dest.jar}"/>
+        <deployfile stem="ApacheJMeter_junit"      dir="${dest.jar}"/>
+        <deployfile stem="ApacheJMeter_ldap"       dir="${dest.jar}"/>
+        <deployfile stem="ApacheJMeter_monitors"   dir="${dest.jar}"/>
+        <deployfile stem="ApacheJMeter_report"     dir="${dest.jar}"/>
+        <deployfile stem="ApacheJMeter_tcp"        dir="${dest.jar}"/>
+<!-- 
+ -->
+    </target>
+
+    <macrodef name="deployfile">
+        <attribute name="basedir" default="."/>
+        <attribute name="stem" />
+        <attribute name="dir" />
+        <attribute name="packaging" default="jar"/>
+        <attribute name="type" default="${repoType}"/>
+        <attribute name="url" default="${@{type}.url}"/>
+        <attribute name="repositoryId" default="${@{type}.repositoryId}"/>
+
+        <attribute name="resultproperty" default="maven.result" />
+        <element name="args" implicit="true" optional="true" />
+        <sequential>
+          <copy file="@{stem}.pom" tofile="@{stem}.pom.tmp">
+              <filterset>
+                  <filter token="MAVEN.DEPLOY.VERSION" value="${maven.deploy.version}"/>
+              </filterset>
+          </copy>
+          <java classname="org.codehaus.classworlds.Launcher" 
+                fork="true"
+                dir="@{basedir}"
+                failonerror="true" 
+                resultproperty="@{resultproperty}">
+            <jvmarg value="-Xmx512m"/>
+            <classpath>
+              <fileset dir="${maven.home}/boot">
+                <include name="*.jar" />
+              </fileset>
+              <fileset dir="${maven.home}/lib">
+                <include name="*.jar" />
+              </fileset>
+            </classpath>
+            <sysproperty key="classworlds.conf" value="${maven.home}/bin/m2.conf" />
+            <sysproperty key="maven.home" value="${maven.home}" />
+            <arg value="--batch-mode"/>
+            <!--arg value="-X"/-->
+            <arg value="-DgeneratePom=false"/>
+            <arg value="-Durl=@{url}"/>
+            <arg value="-DrepositoryId=@{repositoryId}"/>
+            <arg value="-DpomFile=${pom.dir}/@{stem}.pom.tmp"/>
+            <arg value="-Dpackaging=@{packaging}"/>
+            <arg value="-Dfile=@{dir}/@{stem}.${packaging}"/>
+            <!--arg value="-Dsources=@{dir}/@{stem}.jar"/-->
+            <!--arg value="-Djavadoc=@{dir}/@{stem}.jar"/-->
+            <arg value="deploy:deploy-file"/>
+          </java>
+          <delete file="@{stem}.pom.tmp"/>
+        </sequential>
+      </macrodef>
+    
+</project>
+

Propchange: jmeter/trunk/res/maven/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native