You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by mi...@apache.org on 2008/09/09 17:09:33 UTC

svn commit: r693481 - /openjpa/trunk/openjpa-project/pom.xml

Author: mikedd
Date: Tue Sep  9 08:09:32 2008
New Revision: 693481

URL: http://svn.apache.org/viewvc?rev=693481&view=rev
Log:
OPENJPA-695 making nightly-upload profile more friendly.

Modified:
    openjpa/trunk/openjpa-project/pom.xml

Modified: openjpa/trunk/openjpa-project/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/pom.xml?rev=693481&r1=693480&r2=693481&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/pom.xml (original)
+++ openjpa/trunk/openjpa-project/pom.xml Tue Sep  9 08:09:32 2008
@@ -79,6 +79,10 @@
         <docbook.target>${project.basedir}/target/manual</docbook.target>
         <docbook.version>1.67.2</docbook.version>
         <local.repository>${settings.localRepository}</local.repository>
+
+        <!-- authentication for nightly uploads -->
+        <nightly.user.name>${user.name}</nightly.user.name>
+        <nightly.password>passw0rd</nightly.password>
         </properties>
 
         <build>
@@ -303,6 +307,17 @@
                 </pluginRepository>
             </pluginRepositories>
         </profile>
+        <!-- 
+          Upload distribution files, javadoc and manual to openjpa.apache.org/builds/latest. 
+          This profile is designed to be run nightly by a continuous build server, but can
+          also be run manually.
+
+          The nightly.user.name and nightly.password properties need to be set prior to using
+          this profile, ie : 
+          $ mvn -Dnightly.user.name=mikedd -Dnightly.password=mikesPassword -Pnightly-upload package
+          or (using a profile defined in $user.home/.m2/settings.xml )
+          $ mvn -Pnightly-upload,mikes-nightly-credentials package
+          -->
         <profile>
             <id>nightly-upload</id>
             <build>
@@ -313,7 +328,7 @@
                             <execution>
                                 <phase>package</phase>
                                 <configuration>
-                                    <tasks> 
+                                    <tasks>
                                         <mkdir dir="target/site/tempDocs"/>
                                         <unzip dest="target/site/tempDocs">
                                             <fileset dir="target/site/downloads">
@@ -324,29 +339,23 @@
                                                 <include name="**/manual/**"/>
                                             </patternset>
                                         </unzip>
-                                        <chmod perm="g+rw">
-                                             <fileset dir="target/site/downloads"/>
-                                        </chmod>
-                                        <!-- chmod returns 255 on the javadoc and manual dirs -->
-                                        <exec executable="chmod">
-                                            <arg value="-R"/>
-                                            <arg value="g+w"/>
-                                            <arg value="target/site/tempDocs"/>
-                                        </exec>
+                                        <move todir="target/site/tempDocs/docs">
+                                            <fileset dir="target/site/tempDocs/apache-openjpa-${pom.version}/docs"/> 
+                                        </move>
+                                        <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest/downloads">
+                                            <fileset dir="target/site/downloads"/>
+                                        </scp>
                                         
-                                        <!-- From the ant manual if we need to 
-                                             preserve permissions we should use exec
-                                          -->
-                                        <exec executable="scp">
-                                            <arg value="-rp"/>
-                                            <arg value="target/site/downloads"/>
-                                            <arg value="people.apache.org:/www/openjpa.apache.org/builds/latest/"/>
-                                        </exec>
-                                        <exec executable="scp">
-                                            <arg value="-rp"/>
-                                            <arg value="target/site/tempDocs/apache-openjpa-${pom.version}/docs/"/>
-                                            <arg value="people.apache.org:/www/openjpa.apache.org/builds/latest/"/>
-                                        </exec>
+                                        <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest/docs">
+                                            <fileset dir="target/site/tempDocs/docs"/> 
+                                        </scp>
+                                        <sshexec host="people.apache.org" 
+                                                 username="${nightly.user.name}" 
+                                                 password="${nightly.password}"
+                                                 command="chmod -R g+w /www/openjpa.apache.org/builds/latest"/>
+                                        <delete>
+                                            <fileset dir="target/site/tempDocs"/>
+                                        </delete>
                                     </tasks>
                                 </configuration>
                                 <goals>
@@ -354,6 +363,13 @@
                                 </goals>
                             </execution>
                         </executions>
+                        <dependencies>
+                            <dependency>
+                                <groupId>org.apache.ant</groupId>
+                                <artifactId>ant-jsch</artifactId>
+                                <version>1.7.0</version>
+                            </dependency>
+                        </dependencies>
                     </plugin>
                 </plugins>
             </build>