Permalink
Browse files

Add .zip upload

  • Loading branch information...
1 parent 813a51e commit d97a36389cd4c7a617647293a7e9d4b2ab30ee8f @dsyer dsyer committed Oct 12, 2011
Showing with 216 additions and 64 deletions.
  1. +144 −64 pom.xml
  2. +65 −0 src/ant/upload-dist.xml
  3. +7 −0 src/assembly/dist.xml
View
208 pom.xml
@@ -4,6 +4,7 @@
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-admin</artifactId>
<name>Spring Batch Admin</name>
+ <description>A set of services (Java, JSON) and a UI (webapp) for managing and launching Spring Batch jobs.</description>
<version>1.2.2.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<scm>
@@ -32,6 +33,22 @@
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <!-- dist.* properties are used by the antrun tasks below -->
+ <dist.id>spring-batch-admin</dist.id>
+ <dist.name>Spring Batch Admin</dist.name>
+ <dist.key>BATCHADM</dist.key>
+ <dist.version>${project.version}</dist.version>
+ <dist.finalName>${dist.id}-${dist.version}</dist.finalName>
+ <dist.fileName>${dist.finalName}.zip</dist.fileName>
+ <dist.filePath>target/${dist.fileName}</dist.filePath>
+ <dist.bucketName>dist.springframework.org</dist.bucketName>
+ <!-- these properties should be in ~/.m2/settings.xml
+ <dist.accessKey>s3 access key</dist.accessKey>
+ <dist.secretKey>s3 secret key</dist.secretKey>
+ -->
+ </properties>
<modules>
<module>spring-batch-admin-parent</module>
<module>spring-batch-admin-resources</module>
@@ -106,39 +123,6 @@
</build>
</profile>
<profile>
- <id>zip</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <configuration>
- <skip>false</skip>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <inherited>false</inherited>
- <executions>
- <execution>
- <id>zip-files</id>
- <inherited>false</inherited>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/dist.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
<id>milestone</id>
<distributionManagement>
<repository>
@@ -160,6 +144,9 @@
</profile>
<profile>
<id>staging</id>
+ <properties>
+ <dist.staging>/${java.io.tmpdir}/spring-batch-admin/dist</dist.staging>
+ </properties>
<distributionManagement>
<site>
<id>staging</id>
@@ -175,6 +162,85 @@
</snapshotRepository>
</distributionManagement>
</profile>
+ <profile>
+ <id>upload</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>render-books</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>aggregate</id>
+ <goals>
+ <goal>aggregate</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin><!--
+ run `mvn package assembly:assembly` to trigger assembly creation.
+ see http://www.sonatype.com/books/mvnref-book/reference/assemblies-set-dist-assemblies.html -->
+ <artifactId>maven-assembly-plugin</artifactId>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>distribution</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.4</version>
+ <executions>
+ <execution>
+ <id>upload-dist</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <ant antfile="${basedir}/src/ant/upload-dist.xml">
+ <target name="upload-dist" />
+ </ant>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.build</groupId>
+ <artifactId>org.springframework.build.aws.ant</artifactId>
+ <version>3.0.5.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>net.java.dev.jets3t</groupId>
+ <artifactId>jets3t</artifactId>
+ <version>0.7.2</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
<build>
<extensions>
@@ -209,6 +275,39 @@
<junitArtifactName>junit:junit</junitArtifactName>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-maven-plugin</artifactId>
+ <configuration>
+ <books>
+ <book>
+ <directory>src/books/reference</directory>
+ <descriptor>src/books/reference.xml </descriptor>
+ <formats>
+ <format>
+ <id>xdoc</id>
+ </format>
+ <format>
+ <id>pdf</id>
+ </format>
+ <format>
+ <id>xhtml</id>
+ </format>
+ </formats>
+ </book>
+ </books>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <inherited>false</inherited>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/dist.xml</descriptor>
+ </descriptors>
+ <appendAssemblyId>false</appendAssemblyId>
+ </configuration>
+ </plugin>
</plugins>
</pluginManagement>
<plugins>
@@ -220,6 +319,18 @@
</configuration>
</plugin>
<plugin>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>render-books</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
@@ -271,37 +382,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.doxia</groupId>
- <artifactId>doxia-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>pre-site</phase>
- <goals>
- <goal>render-books</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <books>
- <book>
- <directory>src/books/reference</directory>
- <descriptor>src/books/reference.xml </descriptor>
- <formats>
- <format>
- <id>xdoc</id>
- </format>
- <format>
- <id>pdf</id>
- </format>
- <format>
- <id>xhtml</id>
- </format>
- </formats>
- </book>
- </books>
- </configuration>
- </plugin>
</plugins>
</build>
<reporting>
View
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<project name="upload-dist-tasks">
+
+<!-- can be run independent of maven as follows (but it's easier
+ to simply use "mvn antrun:run"):
+ - classpath must be uncommented below. when run from maven,
+ - the classpath is set up for you
+
+ant -f src/ant/upload-dist.xml \
+ -Ddist.id=spring-batch-admin \
+ -Ddist.name='Spring Batch Admin' \
+ -Ddist.key=BATCHADM \
+ -Ddist.accessKey=<access key> \
+ -Ddist.secretKey=<secret key> \
+ -Ddist.bucketName=dist.springframework.org \
+ -Ddist.fileName=spring-batch-admin-1.0.0.M1.zip \
+ -Ddist.filePath=../../spring-batch-admin-1.0.0.M1.zip \
+ -Ddist.version=1.0.0.M1 \
+ upload-dist
+-->
+
+ <taskdef resource="org/springframework/build/aws/ant/antlib.xml">
+ <!-- see comment above
+ <classpath>
+ <pathelement location="/Users/cbeams/Desktop/org.springframework.build.aws.ant-3.0.5.RELEASE.jar"/>
+ <pathelement location="/Users/cbeams/.m2/repository/net/java/dev/jets3t/jets3t/0.7.2/jets3t-0.7.2.jar"/>
+ <pathelement location="/Users/cbeams/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
+ <pathelement location="/Users/cbeams/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
+ <pathelement location="/Users/cbeams/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar"/>
+ </classpath>
+ -->
+ </taskdef>
+ <target name="upload-dist" depends="upload-prep,upload-s3,upload-staging"/>
+ <target name="upload-prep">
+ <condition property="dist.releaseType" value="snapshot">
+ <contains string="${dist.version}" substring="snapshot" casesensitive="false"/>
+ </condition>
+ <condition property="dist.releaseType" value="release" else="milestone">
+ <contains string="${dist.version}" substring="release" casesensitive="false"/>
+ </condition>
+ </target>
+ <target name="upload-s3" unless="dist.staging">
+ <checksum file="${dist.filePath}" algorithm="sha1"/>
+ <s3 accessKey="${dist.accessKey}" secretKey="${dist.secretKey}">
+ <upload bucketName="${dist.bucketName}" file="${dist.filePath}"
+ toFile="${dist.releaseType}/${dist.key}/${dist.fileName}" publicRead="true">
+ <metadata name="project.name" value="${dist.name}"/>
+ <metadata name="release.type" value="${dist.releaseType}"/>
+ <metadata name="bundle.version" value="${dist.version}"/>
+ <metadata name="package.file.name" value="${dist.fileName}"/>
+ </upload>
+ <upload bucketName="${dist.bucketName}" file="${dist.filePath}.sha1"
+ toFile="${dist.releaseType}/${dist.key}/${dist.fileName}.sha1" publicRead="true">
+ </upload>
+ </s3>
+ </target>
+ <target name="upload-staging" if="dist.staging">
+ <echo>Copying dist .ZIP to ${dist.staging}</echo>
+ <checksum file="${dist.filePath}" algorithm="sha1"/>
+ <copy file="${dist.filePath}.sha1"
+ toFile="${dist.staging}/${dist.key}/${dist.fileName}.sha1"/>
+ <copy file="${dist.filePath}"
+ toFile="${dist.staging}/${dist.key}/${dist.fileName}"/>
+ </target>
+</project>
View
@@ -84,5 +84,12 @@
<include>notice.txt</include>
</includes>
</fileSet>
+ <fileSet>
+ <!-- adds reference manual (html and pdf) to the distribution archive under the
+ 'docs/reference' directory
+ see pom.xml 'maven-javadoc-plugin' declaration -->
+ <directory>target/generated-site</directory>
+ <outputDirectory>docs/reference</outputDirectory>
+ </fileSet>
</fileSets>
</assembly>

0 comments on commit d97a363

Please sign in to comment.