Switch build system to gradle

This commit is contained in:
Ramnivas Laddad
2014-02-17 09:36:38 -08:00
parent fe643b18a4
commit 7972c67d09
29 changed files with 442 additions and 491 deletions

2
.gitignore vendored
View File

@@ -3,4 +3,6 @@
.settings
.metadata
target
build
Servers
.gradle

66
build.gradle Normal file
View File

@@ -0,0 +1,66 @@
buildscript {
repositories {
maven { url 'http://repo.springsource.org/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.5'
}
}
ext {
springVersion = "3.0.7.RELEASE"
tomcatVersion = "7.0.42"
springAmqpVersion = "1.0.0.RELEASE"
springDataRedisVersion = "1.0.0.RELEASE"
springDataMongoVersion = "1.0.1.RELEASE"
commonDbcpVersion = "1.3"
mysqlDriverVersion = "5.0.5"
mariadbDriverVersion = "1.1.3"
postgresDriverVersion = "9.0-801.jdbc4"
javaxMailVersion = "1.4.7"
cglibVersion = "2.2.2"
jacksonVersion = "2.2.2"
log4jVersion = "1.2.14"
junitVersion = "4.11"
mockitoVersion = "1.9.5"
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'propdeps-idea'
apply plugin: 'propdeps-eclipse'
sourceCompatibility = 1.6
targetCompatibility = 1.6
task packageSources(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts.archives packageSources
dependencies {
testCompile("junit:junit:$junitVersion")
testCompile("org.mockito:mockito-core:$mockitoVersion")
}
repositories {
mavenLocal()
maven { url "http://repo.spring.io/snapshot" }
maven { url "http://repo.spring.io/milestone" }
maven { url "http://repo.spring.io/libs-milestone" }
maven { url "http://repo.maven.apache.org/maven2" }
}
}

View File

@@ -1 +1,2 @@
dependency-reduced-pom.xml
/bin

View File

@@ -0,0 +1,36 @@
description = 'Spring-Cloud CloudFoundry Connector'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:0.8'
}
}
apply plugin: 'shadow'
dependencies {
compile project(':core')
compile("com.fasterxml.jackson.core:jackson-core:$jacksonVersion")
compile("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
}
shadow {
relocation {
pattern = 'com.fasterxml.jackson'
shadedPattern = 'org.springframework.cloud.cloudfoundry.com.fasterxml.jackson'
}
}
task moveShadowJar(type: Copy) {
from "$buildDir/distributions/${archivesBaseName}-${version}-shadow.jar"
into "$buildDir/libs"
rename { String fileName ->
fileName.replace('-shadow', '')
}
}
moveShadowJar.dependsOn shadowJar
assemble.dependsOn moveShadowJar

View File

@@ -1,84 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>cloudfoundry-connector</artifactId>
<packaging>jar</packaging>
<name>Spring-Cloud CloudFoundry Connector</name>
<url>http://www.springframework.org</url>
<description><![CDATA[Spring Cloud connector for CloudFoundry]]></description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>parent</artifactId>
<version>0.9.6.BUILD-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<properties>
<jackson.version>2.2.2</jackson.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Shade the jackson dependency, so that we aren't affected by the version of the
library in the app and vice-versa -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.fasterxml.jackson.core:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>org.springframework.cloud.cloudfoundry.com.fasterxml.jackson</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

1
core/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/bin

16
core/build.gradle Normal file
View File

@@ -0,0 +1,16 @@
description = 'Spring-Cloud Core'
configurations {
tests
}
task testJar(type: Jar) {
classifier = 'tests'
from sourceSets.test.output.classesDir
}
build.dependsOn testJar
artifacts {
tests testJar
}

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>core</artifactId>
<packaging>jar</packaging>
<name>Cloud Core</name>
<url>http://www.springframework.org</url>
<description>
<![CDATA[
Core components of Spring Cloud.
]]>
</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>parent</artifactId>
<version>0.9.6.BUILD-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@@ -6,9 +6,9 @@ import static org.junit.Assert.assertNotNull;
import java.util.List;
import org.junit.Test;
import org.springframework.cloud.CloudTestUtil.StubCloudConnector;
import org.springframework.cloud.service.ServiceConnectorCreator;
import org.springframework.cloud.service.ServiceInfo;
import org.springframework.cloud.test.CloudTestUtil.StubCloudConnector;
/**
*

View File

@@ -12,14 +12,13 @@ import java.util.Properties;
import org.junit.Before;
import org.junit.Test;
import org.springframework.cloud.CloudTestUtil.StubApplicationInstanceInfo;
import org.springframework.cloud.CloudTestUtil.StubCloudConnector;
import org.springframework.cloud.CloudTestUtil.StubServiceInfo;
import org.springframework.cloud.service.BaseServiceInfo;
import org.springframework.cloud.service.ServiceConnectorConfig;
import org.springframework.cloud.service.ServiceConnectorCreator;
import org.springframework.cloud.service.ServiceInfo;
import org.springframework.cloud.test.CloudTestUtil;
import org.springframework.cloud.test.CloudTestUtil.StubApplicationInstanceInfo;
import org.springframework.cloud.test.CloudTestUtil.StubCloudConnector;
import org.springframework.cloud.test.CloudTestUtil.StubServiceInfo;
/**
*

View File

@@ -1,4 +1,4 @@
package org.springframework.cloud.test;
package org.springframework.cloud;
import static org.junit.Assert.assertEquals;

View File

@@ -1,8 +1,8 @@
package org.springframework.cloud;
import org.springframework.cloud.CloudTestUtil.StubServiceInfo;
import org.springframework.cloud.service.AbstractServiceConnectorCreator;
import org.springframework.cloud.service.ServiceConnectorConfig;
import org.springframework.cloud.test.CloudTestUtil.StubServiceInfo;
/**
*

View File

@@ -1 +1 @@
org.springframework.cloud.test.CloudTestUtil$StubCloudConnector # for testing purpose only
org.springframework.cloud.CloudTestUtil$StubCloudConnector # for testing purpose only

2
gradle.properties Normal file
View File

@@ -0,0 +1,2 @@
group = org.springframework.cloud
version = 0.9.6.BUILD-SNAPSHOT

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,6 @@
#Mon Feb 10 11:26:10 PST 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-bin.zip

164
gradlew vendored Executable file
View File

@@ -0,0 +1,164 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

90
gradlew.bat vendored Normal file
View File

@@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

1
heroku-connector/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/bin

View File

@@ -0,0 +1,5 @@
description = 'Spring-Cloud Heroku Connector'
dependencies {
compile project(':core')
}

View File

@@ -1,46 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>heroku-connector</artifactId>
<packaging>jar</packaging>
<name>Spring-Cloud Heroku Connector</name>
<url>http://www.springframework.org</url>
<description>
<![CDATA[
Cloud connector for Heroku
]]>
</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>parent</artifactId>
<version>0.9.6.BUILD-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-service-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
</dependencies>
</project>

View File

@@ -1,93 +0,0 @@
<?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>
<groupId>org.springframework.cloud</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<name>Spring Cloud Parent</name>
<version>0.9.6.BUILD-SNAPSHOT</version>
<properties>
<junit.version>4.11</junit.version>
<mockito.version>1.9.5</mockito.version>
</properties>
<build>
<extensions>
<extension>
<groupId>org.springframework.build</groupId>
<artifactId>aws-maven</artifactId>
<version>4.4.0.RELEASE</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<!-- For testing against latest Spring snapshots -->
<repository>
<id>spring-snapshot</id>
<name>Spring Maven Snapshot Repository</name>
<url>http://repo.spring.io/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<!-- For developing against latest Spring milestones -->
<repository>
<id>spring-milestone</id>
<name>Spring Maven Milestone Repository</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-lib-milestone</id>
<name>Spring Maven Milestone Repository</name>
<url>http://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>spring-milestone</id>
<name>Spring Milestone Repository</name>
<url>s3://maven.springframework.org/milestone</url>
</repository>
<snapshotRepository>
<id>spring-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>s3://maven.springframework.org/snapshot</url>
</snapshotRepository>
</distributionManagement>
</project>

22
pom.xml
View File

@@ -1,22 +0,0 @@
<?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>cloud</artifactId>
<packaging>pom</packaging>
<name>Spring Cloud (Aggregate)</name>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>parent</artifactId>
<version>0.9.6.BUILD-SNAPSHOT</version>
<relativePath>parent/pom.xml</relativePath>
</parent>
<modules>
<module>parent</module>
<module>core</module>
<module>spring-service-connector</module>
<module>cloudfoundry-connector</module>
<module>heroku-connector</module>
</modules>
</project>

6
settings.gradle Normal file
View File

@@ -0,0 +1,6 @@
rootProject.name = "spring-cloud"
include 'core'
include 'cloudfoundry-connector'
include 'spring-service-connector'
include 'heroku-connector'

1
spring-service-connector/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/bin

View File

@@ -0,0 +1,35 @@
description = 'Service Connectors'
dependencies {
testCompile project(path: ':core', configuration: 'tests')
compile project(':core')
compile("org.springframework:spring-context:$springVersion")
compile("log4j:log4j:$log4jVersion")
testCompile("org.springframework:spring-test:$springVersion")
testCompile("mysql:mysql-connector-java:$mysqlDriverVersion")
testCompile("org.mariadb.jdbc:mariadb-java-client:$mariadbDriverVersion")
testCompile("postgresql:postgresql:$postgresDriverVersion")
testCompile("javax.mail:mail:$javaxMailVersion")
testCompile("cglib:cglib:$cglibVersion")
optional("org.springframework:spring-jdbc:$springVersion")
optional("org.springframework:spring-context-support:$springVersion")
optional("org.apache.tomcat:tomcat-jdbc:$tomcatVersion")
optional("org.apache.tomcat:tomcat-dbcp:$tomcatVersion")
optional("commons-dbcp:commons-dbcp:$commonDbcpVersion") {
exclude(module: 'commons-logging')
exclude(module: 'commons-pool')
exclude(module: 'xerces')
exclude(module: 'xercesImpl')
exclude(module: 'xml-apis')
}
optional("org.springframework.amqp:spring-rabbit:$springAmqpVersion")
optional("org.springframework.data:spring-data-redis:$springDataRedisVersion") {
exclude(module: 'spring-context-support')
}
optional("org.springframework.data:spring-data-mongodb:$springDataMongoVersion") {
exclude(module: 'spring-beans')
exclude(module: 'spring-expression')
exclude(module: 'spring-tx')
}
}

View File

@@ -1,206 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-service-connector</artifactId>
<packaging>jar</packaging>
<name>Service Connectors</name>
<url>http://www.springframework.org</url>
<description>
<![CDATA[
Service Connectors for DataSource and spring-data connector factories
]]>
</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>parent</artifactId>
<version>0.9.6.BUILD-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<properties>
<spring.framework.version>3.0.7.RELEASE</spring.framework.version>
<tomcat.version>7.0.42</tomcat.version>
<spring.amqp.version>1.0.0.RELEASE</spring.amqp.version>
<spring-data-redis.version>1.0.0.RELEASE</spring-data-redis.version>
<spring-data-mongo.version>1.0.1.RELEASE</spring-data-mongo.version>
<common-dbcp.version>1.3</common-dbcp.version>
<mysql-driver.version>5.0.5</mysql-driver.version>
<mariadb-driver.version>1.1.3</mariadb-driver.version>
<postgres-driver.version>9.0-801.jdbc4</postgres-driver.version>
<javax-mail.version>1.4.7</javax-mail.version>
<cglib.version>2.2.2</cglib.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.framework.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.framework.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>${tomcat.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-dbcp</artifactId>
<version>${tomcat.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>${common-dbcp.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
<version>${spring.amqp.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>${spring-data-redis.version}</version>
<exclusions>
<!-- Exclude dependencies on newer Spring versions -->
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</exclusion>
</exclusions>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>${spring-data-mongo.version}</version>
<exclusions>
<!-- Exclude dependencies on newer Spring versions -->
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</exclusion>
</exclusions>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-driver.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>${mariadb-driver.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres-driver.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>${javax-mail.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>${cglib.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -3,7 +3,7 @@ package org.springframework.cloud;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.springframework.cloud.test.CloudTestUtil.getTestCloudConnector;
import static org.springframework.cloud.CloudTestUtil.getTestCloudConnector;
import java.util.ArrayList;
import java.util.List;

View File

@@ -7,7 +7,6 @@ import org.springframework.cloud.service.common.MysqlServiceInfo;
import org.springframework.cloud.service.common.PostgresqlServiceInfo;
import org.springframework.cloud.service.common.RabbitServiceInfo;
import org.springframework.cloud.service.common.RedisServiceInfo;
import org.springframework.cloud.test.CloudTestUtil;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -29,6 +28,7 @@ abstract public class StubCloudConnectorTest {
@Override
protected void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory) {
CloudFactory cloudFactory = new CloudFactory();
cloudFactory.getCloudConnectors().clear();
cloudFactory.registerCloudConnector(stubCloudConnector);
getBeanFactory().registerSingleton(MOCK_CLOUD_BEAN_NAME, cloudFactory);
super.prepareBeanFactory(beanFactory);
@@ -43,6 +43,7 @@ abstract public class StubCloudConnectorTest {
@Override
protected void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory) {
CloudFactory cloudFactory = new CloudFactory();
cloudFactory.getCloudConnectors().clear();
cloudFactory.registerCloudConnector(stubCloudConnector);
getBeanFactory().registerSingleton(MOCK_CLOUD_BEAN_NAME, cloudFactory);
super.prepareBeanFactory(beanFactory);