./gradlew build passing

This commit is contained in:
Gareth Clay
2020-06-18 15:04:50 +01:00
committed by Gareth Clay
parent 2ec6bfc4af
commit 036f5bbf29
13 changed files with 163 additions and 193 deletions

View File

@@ -22,39 +22,19 @@ plugins {
}
ext {
springBootVersion = project.findProperty("springBootVersion") ?: "2.2.7.RELEASE"
springFrameworkVersion = project.findProperty("springFrameworkVersion") ?: "5.2.6.RELEASE"
reactorVersion = project.findProperty("reactorVersion") ?: "Dysprosium-SR7"
openServiceBrokerVersion = "3.1.1.RELEASE"
springCredhubVersion = "2.1.1.RELEASE"
cfJavaClientVersion = "4.7.0.RELEASE"
blockHoundVersion = "1.0.3.RELEASE"
junitPlatformLauncherVersion = "1.6.2"
checkstyleVersion = "8.33"
pmdVersion = "6.24.0"
javadocLinks = [
"https://docs.oracle.com/javase/8/docs/api/",
"https://docs.spring.io/spring/docs/${springFrameworkVersion}/javadoc-api/",
"https://docs.spring.io/spring/docs/${springFrameworkVersion}/javadoc-api/"
] as String[]
}
//override managed Spring Boot versions
if (project.hasProperty("springFrameworkVersion")) {
ext['spring-framework.version'] = ext.springFrameworkVersion
}
if (project.hasProperty("reactorVersion")) {
ext['reactor-bom.version'] = ext.reactorVersion
}
if (!project.hasProperty("onlyShowStandardStreamsOnTestFailure")) {
ext.onlyShowStandardStreamsOnTestFailure = false
}
// override managed Spring Boot versions
ext['spring-framework.version'] = springFrameworkVersion
ext['reactor-bom.version'] = reactorVersion
description = "Spring Cloud App Broker"
allprojects {
apply plugin: "io.spring.nohttp"
afterEvaluate { project ->
if (project.description == null || project.description.isEmpty()) {
throw new InvalidUserDataException("A project description is required for publishing to maven central")
@@ -62,40 +42,6 @@ allprojects {
}
}
configure(allprojects - documentationProjects) {
apply plugin: "checkstyle"
apply plugin: "pmd"
checkstyle {
configFile = file("${project.rootDir}/src/checkstyle/checkstyle.xml")
toolVersion = "${checkstyleVersion}"
showViolations = true
}
// TODO configure checkstyle
// checkstyleMain {
// source = "src/main/java"
// }
// checkstyleTest {
// source = "src/test/java"
// }
pmd {
toolVersion = "${pmdVersion}"
consoleOutput = true
}
// TODO configure PMD
// pmdMain {
// ruleSets = []
// ruleSetFiles = files("${project.rootDir}/src/pmd/pmdRuleSet.xml")
// source = "src/main/java"
// }
// pmdTest {
// ruleSets = []
// ruleSetFiles = files("${project.rootDir}/src/pmd/pmdTestRuleSet.xml")
// source = "src/test/java"
// }
}
configure(codeProjects) {
apply plugin: 'java-library'
apply plugin: "io.spring.dependency-management"
@@ -113,15 +59,11 @@ configure(codeProjects) {
maven { url "https://repo.spring.io/snapshot" }
}
}
}
configure(libraryProjects) {
apply plugin: "jacoco"
sourceCompatibility = 1.8
targetCompatibility = 1.8
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
@@ -149,48 +91,6 @@ configure(libraryProjects) {
"-Werror"
]
jar {
manifest.attributes["Created-By"] =
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
manifest.attributes["Implementation-Title"] = project.name
manifest.attributes["Implementation-Version"] = project.version
from("${rootProject.projectDir}/src/dist") {
include "license.txt"
include "notice.txt"
into "META-INF"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
}
javadoc {
description = "Generates project-level javadoc for use in -javadoc jar"
options.memberLevel = JavadocMemberLevel.PROTECTED
options.author = true
options.header = project.name
options.links(javadocLinks)
options.addStringOption('Xdoclint:none', '-quiet')
}
sourcesJar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set "sources"
from sourceSets.main.allJava
}
javadocJar {
archiveClassifier.set "javadoc"
from javadoc
}
// TODO configure maven publication
// https://docs.gradle.org/current/userguide/publishing_setup.html#publishing_overview
// artifacts {
// archives sourcesJar
// archives javadocJar
// }
tasks.withType(Test).forEach { Test task ->
task.with {
// enable JUnit 5
@@ -248,6 +148,94 @@ configure(libraryProjects) {
// exclude JUnit 4 globally, in favor of JUnit 5
testImplementation.exclude group: "junit", module: "junit"
testImplementation.exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
compileOnly.defaultDependencies { dependencies ->
dependencies.add project.dependencies.create("org.immutables:value:${immutablesVersion}")
}
testCompileOnly.extendsFrom(compileOnly)
}
}
configure(testProjects) {
javadoc {
enabled = false
}
}
configure(libraryProjects) {
jar {
manifest.attributes["Created-By"] = "${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
manifest.attributes["Implementation-Title"] = project.name
manifest.attributes["Implementation-Version"] = project.version
from("${rootProject.projectDir}/src/dist") {
include "license.txt"
include "notice.txt"
into "META-INF"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
}
javadoc {
description = "Generates project-level javadoc for use in -javadoc jar"
options.memberLevel = JavadocMemberLevel.PROTECTED
options.author = true
options.header = project.name
options.links(javadocLinks)
options.addStringOption('Xdoclint:none', '-quiet')
}
sourcesJar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set "sources"
from sourceSets.main.allJava
}
javadocJar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set "javadoc"
from javadoc
}
// TODO configure maven publication
// https://docs.gradle.org/current/userguide/publishing_setup.html#publishing_overview
// artifacts {
// archives sourcesJar
// archives javadocJar
// }
}
configure(staticAnalysisProjects) {
apply plugin: "checkstyle"
apply plugin: "pmd"
apply plugin: "jacoco"
checkstyle {
configFile = file("${project.rootDir}/src/checkstyle/checkstyle.xml")
toolVersion = "${checkstyleVersion}"
showViolations = true
}
checkstyleMain {
source = "src/main/java"
}
checkstyleTest {
source = "src/test/java"
}
pmd {
toolVersion = "${pmdVersion}"
consoleOutput = true
}
pmdMain {
ruleSets = []
ruleSetFiles = files("${project.rootDir}/src/pmd/pmdRuleSet.xml")
source = "src/main/java"
}
pmdTest {
ruleSets = []
ruleSetFiles = files("${project.rootDir}/src/pmd/pmdTestRuleSet.xml")
source = "src/test/java"
}
}
@@ -256,7 +244,16 @@ def getDocumentationProjects() {
}
def getCodeProjects() {
return starterProjects + libraryProjects + documentationProjects
subprojects
}
def getStaticAnalysisProjects() {
codeProjects - documentationProjects
}
def getTestProjects() {
[project(":spring-cloud-app-broker-integration-tests"),
project(":spring-cloud-app-broker-acceptance-tests")] as Set
}
def getStarterProjects() {
@@ -266,7 +263,7 @@ def getStarterProjects() {
}
def getLibraryProjects() {
subprojects - documentationProjects - starterProjects
codeProjects - documentationProjects - starterProjects - testProjects
}
task api(type: Javadoc) {
@@ -287,8 +284,6 @@ task api(type: Javadoc) {
project.sourceSets.main.compileClasspath
})
exclude 'org/springframework/cloud/appbroker/integration/**',
'org/springframework/cloud/appbroker/acceptance/**'
maxMemory = "1024m"
destinationDir = new File(buildDir, "api")
}
@@ -318,12 +313,7 @@ task distZip(type: Zip, dependsOn: docsZip) {
from(zipTree(docsZip.archiveFileName)) { into "${baseDir}/docs" }
def mainSubprojects = subprojects - [project(":spring-cloud-starter-app-broker"),
project(":spring-cloud-starter-app-broker-cloudfoundry"),
project(":spring-cloud-app-broker-docs"),
project(":spring-cloud-app-broker-acceptance-tests"),
project(":spring-cloud-app-broker-integration-tests")]
mainSubprojects.each { subproject ->
libraryProjects.each { subproject ->
into ("${baseDir}/libs") {
from subproject.jar
if (subproject.tasks.findByPath("sourcesJar")) {
@@ -337,12 +327,12 @@ task distZip(type: Zip, dependsOn: docsZip) {
}
task codeCoverageReport(type: JacocoReport) {
dependsOn libraryProjects*.test
dependsOn staticAnalysisProjects*.test
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
libraryProjects.each { subproject ->
if (subproject.name.endsWith("-integration-tests") || subproject.name.endsWith("-acceptance-tests")) {
staticAnalysisProjects.each { subproject ->
if (testProjects.contains(subproject)) {
// Work-around for issue with jacoco and multiple-release jar files
// (like Log4J 2.10 and above)
// see https://github.com/jacoco/jacoco/issues/407

View File

@@ -1,2 +1,21 @@
version=1.1.2.BUILD-SNAPSHOT
group=org.springframework.cloud
onlyShowStandardStreamsOnTestFailure = false
assertjVersion = 3.13.2
awaitilityVersion = 4.0.2
blockHoundVersion = 1.0.3.RELEASE
cfJavaClientVersion = 4.7.0.RELEASE
checkstyleVersion = 8.33
immutablesVersion = 2.8.8
junitJupiterVersion = 5.5.2
junitPlatformLauncherVersion = 1.6.2
mockitoVersion = 3.1.0
openServiceBrokerVersion = 3.1.1.RELEASE
pmdVersion = 6.24.0
reactorVersion = Dysprosium-SR7
springBootVersion = 2.2.7.RELEASE
springCredhubVersion = 2.1.1.RELEASE
springFrameworkVersion = 5.2.6.RELEASE
wiremockVersion = 2.25.1

View File

@@ -29,14 +29,16 @@ dependencies {
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.projectreactor:reactor-test")
testImplementation("org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}")
testImplementation("org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}")
}
// omit the version from the test broker jar file
jar {
archiveVersion = ''
archiveVersion.set ''
}
bootJar {
archiveVersion = ''
archiveVersion.set ''
}
test {

View File

@@ -32,8 +32,6 @@ dependencies {
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
annotationProcessor("org.springframework.boot:spring-boot-autoconfigure-processor")
compileOnly "org.immutables:value:2.8.8"
implementation project(":spring-cloud-app-broker-core")
implementation project(":spring-cloud-app-broker-deployer")
implementation project(":spring-cloud-app-broker-deployer-cloudfoundry")

View File

@@ -16,12 +16,6 @@
description = "Spring Cloud App Broker Core"
ext {
junitJupiterVersion = "5.5.2"
assertjVersion = "3.13.2"
mockitoVersion = "3.1.0"
}
dependencyManagement {
imports {
mavenBom "org.springframework:spring-framework-bom:${springFrameworkVersion}"
@@ -30,22 +24,22 @@ dependencyManagement {
}
dependencies {
api("org.springframework.cloud:spring-cloud-open-service-broker-core:${openServiceBrokerVersion}")
api project(":spring-cloud-app-broker-deployer")
api "org.springframework.cloud:spring-cloud-open-service-broker-core:${openServiceBrokerVersion}"
implementation project(":spring-cloud-app-broker-deployer")
implementation("org.springframework:spring-core")
implementation("org.springframework:spring-context")
implementation("io.projectreactor:reactor-core")
implementation("org.apache.commons:commons-text:1.8")
implementation "org.springframework:spring-core"
implementation "org.springframework:spring-context"
implementation "io.projectreactor:reactor-core"
implementation "org.apache.commons:commons-text:1.8"
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:${junitPlatformLauncherVersion}")
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}"
testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junitPlatformLauncherVersion}"
testImplementation("org.springframework:spring-test")
testImplementation("io.projectreactor:reactor-test")
testImplementation("io.projectreactor.tools:blockhound-junit-platform:${blockHoundVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
testImplementation("org.assertj:assertj-core:${assertjVersion}")
testImplementation("org.mockito:mockito-core:${mockitoVersion}")
testImplementation("org.mockito:mockito-junit-jupiter:${mockitoVersion}")
testImplementation "org.springframework:spring-test"
testImplementation "io.projectreactor:reactor-test"
testImplementation "io.projectreactor.tools:blockhound-junit-platform:${blockHoundVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}"
testImplementation "org.assertj:assertj-core:${assertjVersion}"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
testImplementation "org.mockito:mockito-junit-jupiter:${mockitoVersion}"
}

View File

@@ -16,10 +16,6 @@
description = "Spring Cloud App Broker Deployer Cloud Foundry"
ext {
immutablesVersion = "2.8.1"
}
dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
@@ -31,13 +27,10 @@ dependencies {
implementation("org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}")
implementation("org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.immutables:value:${immutablesVersion}")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.projectreactor:reactor-test")
testImplementation("io.projectreactor.tools:blockhound-junit-platform:${blockHoundVersion}")
}

View File

@@ -28,8 +28,6 @@ dependencies {
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.projectreactor.tools:blockhound-junit-platform:${blockHoundVersion}")
}

View File

@@ -14,15 +14,8 @@
* limitations under the License.
*/
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
plugins {
id 'org.springframework.boot'
}
description = "Spring Cloud App Broker Integration Tests"
@@ -30,19 +23,11 @@ description = "Spring Cloud App Broker Integration Tests"
// don't publish the jar for this module
configurations.archives.artifacts.clear()
ext {
wiremockVersion = "2.25.1"
}
apply plugin: 'org.springframework.boot'
dependencies {
implementation project(":spring-cloud-starter-app-broker-cloudfoundry")
implementation("org.springframework.boot:spring-boot-starter-webflux")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.rest-assured:rest-assured")
testImplementation("com.github.tomakehurst:wiremock:${wiremockVersion}")
}

View File

@@ -22,22 +22,13 @@ dependencyManagement {
}
}
ext {
immutablesVersion = "2.8.1"
awaitilityVersion = "4.0.2"
}
dependencies {
implementation "org.springframework.boot:spring-boot-starter-webflux"
implementation "org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}"
implementation "org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}"
implementation "org.immutables:value:${immutablesVersion}"
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude group: 'junit', module: 'junit'
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation(project(":spring-cloud-starter-app-broker-logging"))
testImplementation project(":spring-cloud-starter-app-broker-logging")
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.awaitility:awaitility:${awaitilityVersion}"
}

View File

@@ -29,9 +29,7 @@ dependencies {
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-starter-webflux")
testImplementation("io.projectreactor:reactor-test")
testImplementation("io.projectreactor.tools:blockhound-junit-platform:${blockHoundVersion}")

View File

@@ -24,10 +24,11 @@ dependencyManagement {
dependencies {
api project(":spring-cloud-starter-app-broker")
api "org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}"
api "org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}"
implementation project(":spring-cloud-app-broker-deployer-cloudfoundry")
implementation project(":spring-cloud-app-broker-security-credhub")
implementation("org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}")
implementation("org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}")
}
// TODO maven publication

View File

@@ -23,7 +23,8 @@ dependencyManagement {
}
dependencies {
implementation project(":spring-cloud-starter-app-broker")
api project(":spring-cloud-starter-app-broker")
implementation project(":spring-cloud-app-broker-logging")
}

View File

@@ -24,8 +24,8 @@ dependencyManagement {
dependencies {
api project(":spring-cloud-app-broker-core")
implementation project(":spring-cloud-app-broker-autoconfigure")
implementation "org.springframework.cloud:spring-cloud-starter-open-service-broker:${openServiceBrokerVersion}"
api project(":spring-cloud-app-broker-autoconfigure")
api "org.springframework.cloud:spring-cloud-starter-open-service-broker:${openServiceBrokerVersion}"
}
// TODO maven publication