Upgrade to Gradle 6; fix all the deprecations

This commit is contained in:
Artem Bilan
2019-11-20 17:49:55 -05:00
parent 496d8e92e2
commit 2f1c1ed4ed
5 changed files with 93 additions and 137 deletions

View File

@@ -1,5 +1,5 @@
plugins {
id 'java'
id 'java-library'
id 'eclipse'
id 'idea'
id 'jacoco'
@@ -58,6 +58,11 @@ compileJava {
targetCompatibility = 1.8
}
java {
withJavadocJar()
withSourcesJar()
}
sourceSets {
test {
resources {
@@ -88,43 +93,43 @@ jacoco {
checkstyle {
configFile = file("${rootDir}/src/checkstyle/checkstyle.xml")
toolVersion = '8.25'
toolVersion = '8.26'
}
dependencies {
compile 'org.springframework.integration:spring-integration-core'
compile 'org.springframework.cloud:spring-cloud-aws-core'
compile 'com.fasterxml.jackson.core:jackson-databind'
api 'org.springframework.integration:spring-integration-core'
api 'org.springframework.cloud:spring-cloud-aws-core'
api 'com.fasterxml.jackson.core:jackson-databind'
compile('org.springframework.cloud:spring-cloud-aws-messaging', optional)
compile('org.springframework.integration:spring-integration-file', optional)
compile('org.springframework.integration:spring-integration-http', optional)
implementation 'org.springframework.cloud:spring-cloud-aws-messaging'
implementation 'org.springframework.integration:spring-integration-file'
implementation 'org.springframework.integration:spring-integration-http'
compile("com.amazonaws:amazon-kinesis-client:$kinesisClientVersion", optional)
compile("com.amazonaws:amazon-kinesis-producer:$kinesisProducerVersion", optional)
implementation "com.amazonaws:amazon-kinesis-client:$kinesisClientVersion"
implementation "com.amazonaws:amazon-kinesis-producer:$kinesisProducerVersion"
compile('com.amazonaws:aws-java-sdk-kinesis', optional)
compile('com.amazonaws:aws-java-sdk-dynamodb', optional)
compile("com.amazonaws:dynamodb-lock-client:$dynamodbLockClientVersion", optional)
implementation 'com.amazonaws:aws-java-sdk-kinesis'
implementation 'com.amazonaws:aws-java-sdk-dynamodb'
implementation "com.amazonaws:dynamodb-lock-client:$dynamodbLockClientVersion"
compile("javax.servlet:javax.servlet-api:$servletApiVersion", provided)
implementation "javax.servlet:javax.servlet-api:$servletApiVersion"
testCompile ('org.springframework.integration:spring-integration-test') {
testImplementation ('org.springframework.integration:spring-integration-test') {
exclude group: 'junit'
}
testCompile "org.assertj:assertj-core:$assertjVersion"
testCompile "cloud.localstack:localstack-utils:$localstackVersion"
testImplementation "org.assertj:assertj-core:$assertjVersion"
testImplementation "cloud.localstack:localstack-utils:$localstackVersion"
testCompile ("org.awaitility:awaitility:$awaitilityVersion") {
testImplementation ("org.awaitility:awaitility:$awaitilityVersion") {
exclude group: 'org.hamcrest'
}
testCompile 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testRuntime "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"
testRuntime "org.apache.logging.log4j:log4j-jcl:$log4jVersion"
testRuntime 'org.junit.jupiter:junit-jupiter-engine'
testRuntime 'org.junit.platform:junit-platform-launcher'
testRuntimeOnly "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"
testRuntimeOnly "org.apache.logging.log4j:log4j-jcl:$log4jVersion"
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
eclipse.project.natures += 'org.springframework.ide.eclipse.core.springnature'
@@ -159,7 +164,6 @@ ext.xLintArg = '-Xlint:all,-options'
test {
maxHeapSize = '1024m'
jacoco {
append = false
destinationFile = file("$buildDir/jacoco.exec")
}
useJUnitPlatform()
@@ -210,21 +214,6 @@ task updateCopyrights {
compileJava.dependsOn updateCopyrights
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
sonarqube {
properties {
property 'sonar.jacoco.reportPath', "${buildDir.name}/jacoco.exec"
@@ -338,6 +327,8 @@ task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
}
artifacts {
archives sourcesJar
archives javadocJar
archives distZip
archives docsZip
archives schemaZip

Binary file not shown.

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

29
gradlew vendored
View File

@@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $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" ;;
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
@@ -175,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

View File

@@ -1,82 +1,52 @@
apply plugin: 'maven'
apply plugin: 'maven-publish'
ext.optionalDeps = []
ext.providedDeps = []
ext.optional = { optionalDeps << it }
ext.provided = { providedDeps << it }
install {
repositories.mavenInstaller {
customizePom(pom, project)
}
}
def customizePom(pom, gradleProject) {
pom.whenConfigured { generatedPom ->
// sort to make pom dependencies order consistent to ease comparison of older poms
generatedPom.dependencies = generatedPom.dependencies.sort { dep ->
"$dep.scope:$dep.groupId:$dep.artifactId"
}
def managedVersions = dependencyManagement.managedVersions
generatedPom.dependencies.findAll{dep -> !dep.version }.each { dep ->
dep.version = managedVersions["${dep.groupId}:${dep.artifactId}"]
}
// respect 'optional' and 'provided' dependencies
gradleProject.optionalDeps.each { dep ->
generatedPom.dependencies.find { it.artifactId == dep.name }?.optional = true
}
gradleProject.providedDeps.each { dep ->
generatedPom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided'
}
// eliminate test-scoped dependencies (no need in maven central poms)
generatedPom.dependencies.removeAll { dep ->
dep.scope == 'test'
}
// add all items necessary for maven central publication
generatedPom.project {
name = gradleProject.description
description = gradleProject.description
url = 'https://github.com/spring-projects/spring-integration-aws'
organization {
name = 'SpringIO'
url = 'https://spring.io'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url = 'https://github.com/spring-projects/spring-integration-aws'
connection = 'scm:git:git://github.com/spring-projects/spring-integration-aws'
developerConnection = 'scm:git:git://github.com/spring-projects/spring-integration-aws'
}
developers {
developer {
id = 'amolnayak311'
name = 'Amol Nayak'
email = 'amolnayak311@gmail.com'
}
developer {
id = 'ghillert'
name = 'Gunnar Hillert'
email = 'ghillert@pivotal.io'
}
developer {
id = 'abilan'
name = 'Artem Bilan'
email = 'abilan@pivotal.io'
}
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
afterEvaluate {
name = project.description
description = project.description
}
url = 'https://github.com/spring-projects/spring-amqp'
organization {
name = 'Spring IO'
url = 'https://spring.io/projects/spring-ampq'
}
licenses {
license {
name = 'Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0'
distribution = 'repo'
}
}
scm {
url = 'https://github.com/spring-projects/spring-integration-aws'
connection = 'scm:git:git://github.com/spring-projects/spring-integration-aws'
developerConnection = 'scm:git:git://github.com/spring-projects/spring-integration-aws'
}
developers {
developer {
id = 'artembilan'
name = 'Artem Bilan'
email = 'abilan@pivotal.io'
roles = ['project lead']
}
}
issueManagement {
system = 'GitHub'
url = 'https://github.com/spring-projects/spring-amqp/issues'
}
}
versionMapping {
usage('java-api') {
fromResolutionResult()
}
usage('java-runtime') {
fromResolutionResult()
}
}
}
}
}