diff --git a/build.gradle b/build.gradle index 3b65450d..3f1f6cc6 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ import java.util.concurrent.ConcurrentHashMap plugins { id "io.spring.nohttp" - id "io.spring.dependency-management" + id "io.spring.dependency-management" apply false } ext { @@ -52,6 +52,16 @@ if (!project.hasProperty("onlyShowStandardStreamsOnTestFailure")) { 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") + } + } +} + configure(allprojects - documentationProjects) { apply plugin: "checkstyle" apply plugin: "pmd" @@ -86,9 +96,9 @@ configure(allprojects - documentationProjects) { // } } -configure(subprojects - starterProjects) { - apply plugin: "java-library" - apply plugin: "jacoco" +configure(codeProjects) { + apply plugin: 'java-library' + apply plugin: "io.spring.dependency-management" repositories { mavenCentral() @@ -103,6 +113,10 @@ configure(subprojects - starterProjects) { maven { url "https://repo.spring.io/snapshot" } } } +} + +configure(libraryProjects) { + apply plugin: "jacoco" sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -233,18 +247,7 @@ configure(subprojects - starterProjects) { configurations { // exclude JUnit 4 globally, in favor of JUnit 5 testImplementation.exclude group: "junit", module: "junit" - } -} - -configure(starterProjects) { - apply plugin: 'java-library' -} - -allprojects { - afterEvaluate { project -> - if (project.description == null || project.description.isEmpty()) { - throw new InvalidUserDataException("A project description is required for publishing to maven central") - } + testImplementation.exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' } } @@ -252,6 +255,10 @@ def getDocumentationProjects() { [project(":spring-cloud-app-broker-docs")] as Set } +def getCodeProjects() { + return starterProjects + libraryProjects + documentationProjects +} + def getStarterProjects() { [project(":spring-cloud-starter-app-broker"), project(":spring-cloud-starter-app-broker-cloudfoundry"), @@ -266,7 +273,7 @@ task api(type: Javadoc) { group = "Documentation" description = "Generates aggregated Javadoc API documentation." title = "${rootProject.description} ${version} API" - options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED + options.memberLevel = JavadocMemberLevel.PROTECTED options.author = true options.header = rootProject.description options.links(javadocLinks) diff --git a/settings.gradle b/settings.gradle index 05a624fc..900403cf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,8 +1,11 @@ pluginManagement { plugins { id "io.spring.dependency-management" version "1.0.9.RELEASE" + id "org.springframework.boot" version "2.2.7.RELEASE" id "com.jfrog.artifactory" version "4.15.2" id "io.spring.nohttp" version "0.0.5.RELEASE" + id 'org.asciidoctor.jvm.pdf' version '3.1.0' + id 'org.asciidoctor.jvm.convert' version '3.1.0' } } diff --git a/spring-cloud-app-broker-acceptance-tests/build.gradle b/spring-cloud-app-broker-acceptance-tests/build.gradle index b3157d80..56c8e0b5 100644 --- a/spring-cloud-app-broker-acceptance-tests/build.gradle +++ b/spring-cloud-app-broker-acceptance-tests/build.gradle @@ -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 Acceptance Tests" @@ -30,21 +23,14 @@ description = "Spring Cloud App Broker Acceptance Tests" // don't publish the jar for the acceptance tests project configurations.archives.artifacts.clear() -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.projectreactor:reactor-test") } -// build the test broker from /src into a jar that the tests can deploy -test.dependsOn assemble - // omit the version from the test broker jar file jar { archiveVersion = '' @@ -54,6 +40,9 @@ bootJar { } test { + // build the test broker from /src into a jar that the tests can deploy + dependsOn assemble + maxParallelForks = Runtime.runtime.availableProcessors() - 1 ?: 1 // Only run the tests if acceptanceTests is specified diff --git a/spring-cloud-app-broker-autoconfigure/build.gradle b/spring-cloud-app-broker-autoconfigure/build.gradle index e86698c0..4d7f262e 100644 --- a/spring-cloud-app-broker-autoconfigure/build.gradle +++ b/spring-cloud-app-broker-autoconfigure/build.gradle @@ -29,26 +29,28 @@ java { } dependencies { - compile project(":spring-cloud-app-broker-core") - compile project(":spring-cloud-app-broker-deployer") - compile project(":spring-cloud-app-broker-deployer-cloudfoundry") - loggingImplementation project(":spring-cloud-app-broker-logging") - compile project(":spring-cloud-app-broker-security-credhub") - compile("org.springframework.boot:spring-boot-starter") - compile("org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}") - compile("org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}") - compile("org.springframework.credhub:spring-credhub-starter:${springCredhubVersion}") - annotationProcessor("org.springframework.boot:spring-boot-configuration-processor") annotationProcessor("org.springframework.boot:spring-boot-autoconfigure-processor") - testRuntimeOnly("org.junit.platform:junit-platform-launcher") + compileOnly "org.immutables:value:2.8.8" - testImplementation("org.springframework.boot:spring-boot-starter-test") { - exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' - } + implementation project(":spring-cloud-app-broker-core") + implementation project(":spring-cloud-app-broker-deployer") + implementation project(":spring-cloud-app-broker-deployer-cloudfoundry") + implementation project(":spring-cloud-app-broker-security-credhub") + implementation("org.springframework.boot:spring-boot-starter") + implementation("org.springframework.boot:spring-boot-starter-webflux") + implementation("org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}") + implementation("org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}") + implementation("org.springframework.credhub:spring-credhub-starter:${springCredhubVersion}") + + loggingImplementation project(":spring-cloud-app-broker-logging") + + testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.springframework.boot:spring-boot-starter-webflux") testImplementation("io.projectreactor.tools:blockhound-junit-platform:${blockHoundVersion}") + + testRuntimeOnly("org.junit.platform:junit-platform-launcher") } compileJava.dependsOn(processResources) diff --git a/spring-cloud-app-broker-core/build.gradle b/spring-cloud-app-broker-core/build.gradle index 62eaacb1..8ba2853f 100644 --- a/spring-cloud-app-broker-core/build.gradle +++ b/spring-cloud-app-broker-core/build.gradle @@ -30,12 +30,13 @@ dependencyManagement { } dependencies { - compile project(":spring-cloud-app-broker-deployer") - compile("org.springframework:spring-core") - compile("org.springframework:spring-context") - compile("io.projectreactor:reactor-core") - compile("org.springframework.cloud:spring-cloud-open-service-broker-core:${openServiceBrokerVersion}") - compile("org.apache.commons:commons-text:1.8") + 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") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}") testRuntimeOnly("org.junit.platform:junit-platform-launcher:${junitPlatformLauncherVersion}") diff --git a/spring-cloud-app-broker-deployer-cloudfoundry/build.gradle b/spring-cloud-app-broker-deployer-cloudfoundry/build.gradle index 29b6e5ee..b9812c08 100644 --- a/spring-cloud-app-broker-deployer-cloudfoundry/build.gradle +++ b/spring-cloud-app-broker-deployer-cloudfoundry/build.gradle @@ -27,11 +27,11 @@ dependencyManagement { } dependencies { - compile project(":spring-cloud-app-broker-deployer") - compile("org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}") - compile("org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}") - compile("org.springframework.boot:spring-boot-starter-validation") - compile("org.immutables:value:${immutablesVersion}") + implementation project(":spring-cloud-app-broker-deployer") + 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") diff --git a/spring-cloud-app-broker-deployer/build.gradle b/spring-cloud-app-broker-deployer/build.gradle index 9045ce42..854cd821 100644 --- a/spring-cloud-app-broker-deployer/build.gradle +++ b/spring-cloud-app-broker-deployer/build.gradle @@ -23,8 +23,8 @@ dependencyManagement { } dependencies { - compile("org.springframework:spring-core") - compile("io.projectreactor:reactor-core") + implementation("org.springframework:spring-core") + implementation("io.projectreactor:reactor-core") testRuntimeOnly("org.junit.platform:junit-platform-launcher") diff --git a/spring-cloud-app-broker-docs/build.gradle b/spring-cloud-app-broker-docs/build.gradle index 790e3f5f..2ccdcda5 100644 --- a/spring-cloud-app-broker-docs/build.gradle +++ b/spring-cloud-app-broker-docs/build.gradle @@ -14,15 +14,9 @@ * limitations under the License. */ -buildscript { - repositories { - maven { url "https://repo.spring.io/plugins-release" } - } -} - plugins { - id 'org.asciidoctor.jvm.pdf' version '3.1.0' - id 'org.asciidoctor.jvm.convert' version '3.1.0' + id 'org.asciidoctor.jvm.pdf' + id 'org.asciidoctor.jvm.convert' } description = "Spring Cloud App Broker Documentation" diff --git a/spring-cloud-app-broker-logging/build.gradle b/spring-cloud-app-broker-logging/build.gradle index 13273318..17387497 100644 --- a/spring-cloud-app-broker-logging/build.gradle +++ b/spring-cloud-app-broker-logging/build.gradle @@ -28,10 +28,10 @@ ext { } dependencies { - compile "org.springframework.boot:spring-boot-starter-webflux" - compile "org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}" - compile "org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}" - compile "org.immutables:value:${immutablesVersion}" + 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' diff --git a/spring-cloud-app-broker-security-credhub/build.gradle b/spring-cloud-app-broker-security-credhub/build.gradle index 1a4e5cff..cbae145a 100644 --- a/spring-cloud-app-broker-security-credhub/build.gradle +++ b/spring-cloud-app-broker-security-credhub/build.gradle @@ -23,9 +23,9 @@ dependencyManagement { } dependencies { - compile project(":spring-cloud-app-broker-core") - compile("org.springframework.credhub:spring-credhub-starter:${springCredhubVersion}") - compile("org.springframework.cloud:spring-cloud-open-service-broker-core:${openServiceBrokerVersion}") + implementation project(":spring-cloud-app-broker-core") + implementation("org.springframework.credhub:spring-credhub-starter:${springCredhubVersion}") + implementation("org.springframework.cloud:spring-cloud-open-service-broker-core:${openServiceBrokerVersion}") testRuntimeOnly("org.junit.platform:junit-platform-launcher") diff --git a/spring-cloud-starter-app-broker-cloudfoundry/build.gradle b/spring-cloud-starter-app-broker-cloudfoundry/build.gradle index d58a9c80..e4c0a155 100644 --- a/spring-cloud-starter-app-broker-cloudfoundry/build.gradle +++ b/spring-cloud-starter-app-broker-cloudfoundry/build.gradle @@ -23,11 +23,11 @@ dependencyManagement { } dependencies { - compile project(":spring-cloud-starter-app-broker") - compile project(":spring-cloud-app-broker-deployer-cloudfoundry") - compile project(":spring-cloud-app-broker-security-credhub") - compile("org.cloudfoundry:cloudfoundry-client-reactor:${cfJavaClientVersion}") - compile("org.cloudfoundry:cloudfoundry-operations:${cfJavaClientVersion}") + api project(":spring-cloud-starter-app-broker") + 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 diff --git a/spring-cloud-starter-app-broker-logging/build.gradle b/spring-cloud-starter-app-broker-logging/build.gradle index dde60c20..161d3a92 100644 --- a/spring-cloud-starter-app-broker-logging/build.gradle +++ b/spring-cloud-starter-app-broker-logging/build.gradle @@ -23,8 +23,8 @@ dependencyManagement { } dependencies { - compile project(":spring-cloud-starter-app-broker") - compile project(":spring-cloud-app-broker-logging") + implementation project(":spring-cloud-starter-app-broker") + implementation project(":spring-cloud-app-broker-logging") } // TODO maven publication diff --git a/spring-cloud-starter-app-broker/build.gradle b/spring-cloud-starter-app-broker/build.gradle index e317d71c..c5c3adfa 100644 --- a/spring-cloud-starter-app-broker/build.gradle +++ b/spring-cloud-starter-app-broker/build.gradle @@ -23,7 +23,7 @@ dependencyManagement { } dependencies { - implementation project(":spring-cloud-app-broker-core") + 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}" }