]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
NOJIRA: added hotdeploy task in ant. this task calls cargo:undeploy and cargo:deploy
authorSanjay Dalal <sanjay.dalal@berkeley.edu>
Wed, 11 Nov 2009 20:11:36 +0000 (20:11 +0000)
committerSanjay Dalal <sanjay.dalal@berkeley.edu>
Wed, 11 Nov 2009 20:11:36 +0000 (20:11 +0000)
in order. New maven plugin sets properties from build.properties before calling
cargo tasks. Added new properties into build.properties.

M    services/JaxRsServiceProvider/nbactions.xml
M    services/JaxRsServiceProvider/pom.xml
M    services/JaxRsServiceProvider/build.xml
M    services/build.xml
M    build.properties
M    pom.xml
M    build.xml

build.properties
build.xml
pom.xml
services/JaxRsServiceProvider/build.xml
services/JaxRsServiceProvider/nbactions.xml
services/JaxRsServiceProvider/pom.xml
services/build.xml

index 770a857b11715ecc4b7f0b3e2d5ce62027a976cb..7d84abde8b63889ed02c21d69b5bea0916ca51d5 100644 (file)
@@ -1,5 +1,6 @@
+host=127.0.0.1\r
 #cspace\r
-cspace.release=0.2\r
+cspace.release=0.4\r
 cspace.services.release=cspace-services-${cspace.release}\r
 cspace.services.war=cspace-services.war\r
 domain.cspace=cspace\r
@@ -37,6 +38,7 @@ jboss.home=${jboss.dir}
 \r
 #jboss cspace domain\r
 jboss.domain.cspace=${domain.cspace}\r
+jboss.domain.cspace.port=8180\r
 jboss.server.cspace=${jboss.home}/server/${jboss.domain.cspace}\r
 jboss.deploy.cspace=${jboss.server.cspace}/deploy\r
 jboss.lib.cspace=${jboss.server.cspace}/lib\r
@@ -44,6 +46,7 @@ jboss.deploy.cspace.services=${jboss.server.cspace}/deploy/${cspace.services.war
 \r
 #jboss nuxeo domain\r
 jboss.domain.nuxeo=${domain.nuxeo}\r
+jboss.domain.nuxeo.port=8080\r
 jboss.server.nuxeo=${jboss.home}/server/${jboss.domain.nuxeo}\r
 jboss.deploy.nuxeo=${jboss.server.nuxeo}/deploy\r
 jboss.lib.nuxeo=${jboss.server.nuxeo}/lib\r
index fcdb872e6f1562c9eaf8c50d0e5f3d77a5f2995b..5c3c0d670eec6caf5abb6893431bdf8cf8ada7df 100644 (file)
--- a/build.xml
+++ b/build.xml
     </target>\r
 \r
 \r
+    <target name="hotdeploy" depends="install"\r
+    description="deploy services in running ${jboss.server.cspace}">\r
+        <ant antfile="services/build.xml" target="hotdeploy" inheritAll="false"/>\r
+    </target>\r
+\r
     <target name="eclipse" depends="eclipse-unix,eclipse-windows" description="Generate Eclipse files" />\r
     <target name="eclipse-unix" if="osfamily-unix">\r
         <exec executable="mvn" failonerror="true">\r
diff --git a/pom.xml b/pom.xml
index 2a900bbdcfb8b36cd40d7772b4416131f1720458..a4f6012709178e648585f03abd030695a8d09c5d 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
             <name>libs-snapshots-local</name>\r
             <url>http://source.collectionspace.org:8081/artifactory/libs-snapshots-local</url>\r
         </snapshotRepository>\r
-    </distributionManagement> \r
+    </distributionManagement>\r
     \r
     <modules>\r
         <module>3rdparty</module>\r
         <repository>\r
             <id>collectionspace-releases</id>\r
             <name>collectionspace-releases</name>\r
-            <url>http://source.collectionspace.org:8081/artifactory/public-nuxeo</url>            \r
+            <url>http://source.collectionspace.org:8081/artifactory/public-nuxeo</url>\r
             <releases>\r
                 <enabled>true</enabled>\r
             </releases>\r
             <snapshots>\r
                 <enabled>false</enabled>\r
-            </snapshots>            \r
+            </snapshots>\r
         </repository>\r
         <repository>\r
             <id>collectionspace-snapshots</id>\r
@@ -77,7 +77,7 @@
             <url>http://repo1.maven.org/maven2</url>\r
             <snapshots>\r
                 <enabled>false</enabled>\r
-            </snapshots>            \r
+            </snapshots>\r
         </repository>\r
         <repository>\r
             <id>maven-restlet</id>\r
@@ -85,8 +85,8 @@
             <url>http://maven.restlet.org</url>\r
             <snapshots>\r
                 <enabled>false</enabled>\r
-            </snapshots>            \r
-        </repository>        \r
+            </snapshots>\r
+        </repository>\r
         <repository>\r
             <id>java.net</id>\r
             <name>java.net Maven Repository</name>\r
@@ -94,7 +94,7 @@
             <layout>legacy</layout>\r
             <snapshots>\r
                 <enabled>false</enabled>\r
-            </snapshots>            \r
+            </snapshots>\r
         </repository>\r
         \r
         <!--        \r
             <url>http://repository.jboss.org/maven2</url>\r
             <snapshots>\r
                 <enabled>false</enabled>\r
-            </snapshots>            \r
+            </snapshots>\r
         </repository>\r
         <repository>\r
             <id>mojo</id>\r
             <name>mojo repo</name>\r
-            <url>http://svn.codehaus.org/mojo/trunk/mojo/jboss-maven-plugin</url>\r
+            <url>http://repository.codehaus.org</url>\r
             <snapshots>\r
-                <enabled>false</enabled>\r
-            </snapshots>            \r
+                <enabled>true</enabled>\r
+            </snapshots>\r
         </repository>\r
-        \r
+\r
     </repositories>\r
     \r
     <pluginRepositories>\r
             <url>http://download.java.net/maven/1</url>\r
             <layout>legacy</layout>\r
         </pluginRepository>\r
-        \r
+\r
+        <!-- use snapshort codehaus for cargo plugin -->\r
         <pluginRepository>\r
             <id>codehaus snapshot repository</id>\r
             <url>http://snapshots.repository.codehaus.org/</url>\r
                 <enabled>true</enabled>\r
             </releases>\r
         </pluginRepository>\r
-        \r
+\r
     </pluginRepositories>\r
     \r
     <build>\r
index dff8d98144ea0a9153fee7a08b387876eaa460cd..e6ba44aa676be315326d197fd180dbb6344ce30e 100644 (file)
         </exec>
     </target>
 
+    <target name="hotdeploy" depends="install,hotdeploy-unix,hotdeploy-windows"
+  description="Hot deploy" />
+    <target name="hotdeploy-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="properties:read-project-properties" />
+            <arg value="cargo:undeploy" />
+            <arg value="cargo:deploy" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="hotdeploy-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="properties:read-project-properties" />
+            <arg value="cargo:undeploy" />
+            <arg value="cargo:deploy" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
     <target name="deploy" depends="install"
     description="deploy cspace services in ${jboss.server.cspace}">
         <copy file="${basedir}/target/${cspace-services.war}" todir="${jboss.server.cspace}/deploy"/>
index 9d30c239abd6ef11d33f1639b45ba172edecb3cf..3cc69b94ba4f49ef0d39b7df69ace18766e197e4 100644 (file)
@@ -1,74 +1,60 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<actions>\r
-        <action>\r
-            <actionName>test</actionName>\r
-            <packagings>\r
-                <packaging>*</packaging>\r
-            </packagings>\r
-            <goals>\r
-                <goal>test</goal>\r
-            </goals>\r
-        </action>\r
-        <action>\r
-            <actionName>build</actionName>\r
-            <packagings>\r
-                <packaging>*</packaging>\r
-            </packagings>\r
-            <goals>\r
-                <goal>install</goal>\r
-            </goals>\r
-        </action>\r
-        <action>\r
-            <actionName>clean</actionName>\r
-            <packagings>\r
-                <packaging>*</packaging>\r
-            </packagings>\r
-            <goals>\r
-                <goal>clean</goal>\r
-            </goals>\r
-        </action>\r
-        <action>\r
-            <actionName>rebuild</actionName>\r
-            <packagings>\r
-                <packaging>*</packaging>\r
-            </packagings>\r
-            <goals>\r
-                <goal>clean</goal>\r
-                <goal>install</goal>\r
-            </goals>\r
-            <properties>\r
-                <maven.test.skip>true</maven.test.skip>\r
-            </properties>\r
-        </action>\r
-        <action>\r
-            <actionName>run</actionName>\r
-            <packagings>\r
-                <packaging>war</packaging>\r
-                <packaging>ear</packaging>\r
-                <packaging>ejb</packaging>\r
-            </packagings>\r
-            <goals>\r
-                <goal>package</goal>\r
-            </goals>\r
-            <properties>\r
-                \r
-                <netbeans.deploy>true</netbeans.deploy>\r
-            </properties>\r
-        </action>\r
-        <action>\r
-            <actionName>debug</actionName>\r
-            <packagings>\r
-                <packaging>war</packaging>\r
-                <packaging>ear</packaging>\r
-                <packaging>ejb</packaging>\r
-            </packagings>\r
-            <goals>\r
-                <goal>package</goal>\r
-            </goals>\r
-            <properties>\r
-                \r
-                <netbeans.deploy>true</netbeans.deploy>\r
-                <netbeans.deploy.debugmode>true</netbeans.deploy.debugmode>\r
-            </properties>\r
-        </action>\r
-    </actions>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<actions>
+        <action>
+            <actionName>test</actionName>
+            <goals>
+                <goal>test</goal>
+            </goals>
+        </action>
+        <action>
+            <actionName>build</actionName>
+            <goals>
+                <goal>install</goal>
+            </goals>
+        </action>
+        <action>
+            <actionName>clean</actionName>
+            <goals>
+                <goal>clean</goal>
+            </goals>
+        </action>
+        <action>
+            <actionName>rebuild</actionName>
+            <goals>
+                <goal>clean</goal>
+                <goal>install</goal>
+            </goals>
+            <properties>
+                <maven.test.skip>true</maven.test.skip>
+            </properties>
+        </action>
+        <action>
+            <actionName>run</actionName>
+            <goals>
+                <goal>package</goal>
+            </goals>
+            <properties>
+                
+                <netbeans.deploy>true</netbeans.deploy>
+            </properties>
+        </action>
+        <action>
+            <actionName>debug</actionName>
+            <goals>
+                <goal>package</goal>
+            </goals>
+            <properties>
+                
+                <netbeans.deploy>true</netbeans.deploy>
+                <netbeans.deploy.debugmode>true</netbeans.deploy.debugmode>
+            </properties>
+        </action>
+        <action>
+            <actionName>CUSTOM-redeploy</actionName>
+            <displayName>redeploy</displayName>
+            <goals>
+                <goal>cargo:undeploy</goal>
+                <goal>cargo:deploy</goal>
+            </goals>
+        </action>
+    </actions>
index 68dc953d59a2bcbecdc7347e8e158602c7daa026..db4a04768bb4fe0745eb1e231729a78b45b3b456 100644 (file)
         <finalName>cspace-services</finalName>\r
         <defaultGoal>package</defaultGoal>\r
         <plugins>\r
-            <!--plugin>\r
+            <plugin>\r
                 <groupId>org.codehaus.mojo</groupId>\r
-                <artifactId>jboss-maven-plugin</artifactId>\r
-                <configuration>\r
-                    <serverName>cspace</serverName>\r
-                    <jbossHome>${jboss.dir}</jbossHome>\r
-                    <port>8180</port>\r
-                </configuration>\r
-                <executions>                   \r
+                <artifactId>properties-maven-plugin</artifactId>\r
+                <version>1.0-alpha-2</version>\r
+                <executions>\r
                     <execution>\r
-                        <id>jboss-undeploy</id>\r
-                        <phase>pre-integration-test</phase>\r
+                        <phase>initialize</phase>\r
                         <goals>\r
-                            <goal>undeploy</goal>\r
+                            <goal>read-project-properties</goal>\r
                         </goals>\r
-                        <configuration>\r
-                            <fileNames>\r
-                                <param>${project.build.directory}/${project.build.finalName}.war</param>\r
-                            </fileNames>\r
-                        </configuration>\r
                     </execution>\r
-                    <execution>\r
-                        <id>jboss-deploy</id>\r
-                        <phase>pre-integration-test</phase>\r
-                        <goals>\r
-                            <goal>deploy</goal>\r
-                        </goals>\r
-                        <configuration>\r
-                            <fileNames>\r
-                                <param>${project.build.directory}/${project.build.finalName}.war</param>\r
-                            </fileNames>\r
-                        </configuration>\r
-                    </execution>                \r
                 </executions>\r
-            </plugin-->\r
+                <configuration>\r
+                    <files>\r
+                        <file>../../build.properties</file>\r
+                    </files>\r
+                </configuration>\r
+            </plugin>\r
             <plugin>\r
                 <groupId>org.codehaus.cargo</groupId>\r
                 <artifactId>cargo-maven2-plugin</artifactId>\r
                     <configuration>\r
                         <type>runtime</type>\r
                         <properties>\r
-                            <cargo.servlet.port>8180</cargo.servlet.port>\r
+                            <cargo.servlet.port>${jboss.domain.cspace.port}</cargo.servlet.port>\r
                             <cargo.jboss.configuration>cspace</cargo.jboss.configuration>\r
                         </properties>\r
                     </configuration>\r
                                 <groupId>org.collectionspace.services</groupId>\r
                                 <artifactId>org.collectionspace.services.jaxrs.provider</artifactId>\r
                                 <type>war</type>\r
-                                <pingURL>http://127.0.0.1:8180</pingURL>\r
+                                <pingURL>http://${host}:${jboss.domain.cspace.port}</pingURL>\r
                             </deployable>\r
                         </deployables>\r
                     </deployer>\r
index 74f86b6b96bb76a40eb55deae55709cae1c448d1..754802ca14391a71adfd120788a202b27b5f655a 100644 (file)
         <ant antfile="common/build.xml" target="undeploy" inheritAll="false"/>\r
     </target>\r
 \r
+    <target name="hotdeploy" depends="install"\r
+    description="deploy services in running ${jboss.server.cspace}">\r
+        <ant antfile="JaxRsServiceProvider/build.xml" target="hotdeploy" inheritAll="false"/>\r
+    </target>\r
+\r
     <!-- this target is called in order based on the dependencies between the services -->\r
     <target name="dist" depends="package"\r
     description="create distribution for services">\r