BATCH-1998: Create JSR CI Build

* Added new module "spring-batch-jsr352-tck" containing a maven configuration
  to run the TCK tests.
* Added new profile "jsr-352-tck" to run the TCK tests
* The TCK build relys on the following environment variables being set:
  * JSR_352_TCK_LIBS = the directory used to store libraries used during the TCK execution
  * JSR_352_TCK_HOME = the directory containing the pristine version of the JSR-352 TCK
  * JSR_352_BATCH_IMPL_CLASSES = the : seperated jars to be used and passed to the
    batch.impl.classes property of $JSR_352_TCK_HOME/jsr352-tck.properties. These are
    typically the paths to the JAR's located in $JSR_352_TCK_LIBS

TCK tests can be invoked by activating the jsr-352-tck profile.

At this time, if any errors occur while invoking the TCK ant build, the maven build will
continue. See https://java.net/bugzilla/show_bug.cgi?id=5833 for more details. A work around
is to modify:

$JSR_352_TCK_HOME/build.xml adding the following after </testng> and before </target>

<fail if="tests.failed" message="JSR-352 TCK TESTS FAILED"/>
This commit is contained in:
Chris Schaefer
2014-02-27 14:20:03 -05:00
parent ab9f0f4897
commit cafc7046c1
2 changed files with 236 additions and 30 deletions

63
pom.xml
View File

@@ -439,6 +439,12 @@
</plugins>
</build>
</profile>
<profile>
<id>jsr-352-tck</id>
<modules>
<module>spring-batch-jsr352-tck</module>
</modules>
</profile>
</profiles>
<distributionManagement>
<site>
@@ -466,23 +472,23 @@
</extensions>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>2.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>1.0-beta-7</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>2.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>1.0-beta-7</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
@@ -523,7 +529,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<version>2.7</version>
<configuration>
<skip>true</skip>
</configuration>
@@ -546,11 +552,11 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jdepend-maven-plugin</artifactId>
<version>2.0-beta-2</version>
<version>2.0-beta-2</version>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8.1</version>
<version>2.8.1</version>
<reportSets>
<reportSet>
<id>html</id>
@@ -585,7 +591,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
<version>2.3</version>
</plugin>
</plugins>
</reporting>
@@ -626,17 +632,14 @@
<name>Michael Minella</name>
<email>mminella@vmware.com</email>
</developer>
<developer>
<id>cschaefer</id>
<name>Chris Schaefer</name>
<email>cschaefer@gopivotal.com</email>
</developer>
</developers>
<pluginRepositories>
<!-- <pluginRepository>
<id>com.springsource.repository.bundles.milestone</id>
<name> SpringSource Enterprise Bundle Repository - SpringSource Bundle Milestones</name>
<url>http://repository.springsource.com/maven/bundles/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
--> <pluginRepository>
<pluginRepository>
<id>com.springsource.repository.bundles.snapshot</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Snapshots</name>
<url>http://repository.springsource.com/maven/bundles/snapshot</url>

View File

@@ -0,0 +1,203 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-batch-jsr352-tck</artifactId>
<packaging>pom</packaging>
<name>JSR-352-TCK</name>
<description>Executes the JSR-352-TCK suite</description>
<url>http://docs.spring.io/spring-batch/${project.artifactId}</url>
<parent>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-parent</artifactId>
<version>3.0.0.BUILD-SNAPSHOT</version>
<relativePath>../spring-batch-parent</relativePath>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.framework.version>4.0.2.RELEASE</spring.framework.version>
<jsr352.tck.libs.dir>${env.JSR_352_TCK_LIBS}</jsr352.tck.libs.dir>
<jsr352.tck.home.dir>${env.JSR_352_TCK_HOME}</jsr352.tck.home.dir>
</properties>
<dependencies>
<dependency>
<groupId>javax.batch</groupId>
<artifactId>javax.batch-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging-api</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.5.4</version>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-infrastructure</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache</groupId>
<artifactId>ant-contrib</artifactId>
<version>0.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${jsr352.tck.libs.dir}</outputDirectory>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<phase>prepare-package</phase>
</execution>
</executions>
<configuration>
<filesets>
<fileset>
<directory>${jsr352.tck.libs.dir}</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>ant</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<property name="batch.impl.classes" value="${env.JSR_352_BATCH_IMPL_CLASSES}"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${jsr352.tck.libs.dir}/ant-contrib-0.6.jar"/>
</classpath>
</taskdef>
<trycatch>
<try>
<ant antfile="${jsr352.tck.home.dir}/build.xml" target="run" dir="${jsr352.tck.home.dir}"/>
</try>
</trycatch>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>enforce-property</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireEnvironmentVariable>
<variableName>JSR_352_TCK_LIBS</variableName>
<message>JSR_352_TCK_LIBS environment variable must be set!</message>
</requireEnvironmentVariable>
<requireEnvironmentVariable>
<variableName>JSR_352_TCK_HOME</variableName>
<message>JSR_352_TCK_HOME environment variable must be set!</message>
</requireEnvironmentVariable>
<requireEnvironmentVariable>
<variableName>JSR_352_BATCH_IMPL_CLASSES</variableName>
<message>JSR_352_BATCH_IMPL_CLASSES environment variable must be set!</message>
</requireEnvironmentVariable>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>