diff --git a/build.gradle b/build.gradle index 94478ffc..18f8521f 100644 --- a/build.gradle +++ b/build.gradle @@ -6,9 +6,9 @@ buildscript { plugins { id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false - id 'org.asciidoctor.jvm.pdf' version '3.3.0' - id 'org.asciidoctor.jvm.gems' version '3.3.0' - id 'org.asciidoctor.jvm.convert' version '3.3.0' + id 'org.asciidoctor.jvm.pdf' version '3.3.2' + id 'org.asciidoctor.jvm.gems' version '3.3.2' + id 'org.asciidoctor.jvm.convert' version '3.3.2' id 'de.undercouch.download' version '4.1.2' } @@ -23,7 +23,7 @@ ext { allprojects { group = "org.springframework.webflow" - apply plugin: "java" + apply plugin: "java-library" apply plugin: "io.spring.dependency-management" apply plugin: "org.springframework.build.optional-dependencies" apply from: "${rootProject.projectDir}/ide.gradle" @@ -99,30 +99,6 @@ allprojects { } -subprojects { subproject -> - - apply from: "${rootProject.projectDir}/publish-maven.gradle" - - sourceCompatibility=1.8 - targetCompatibility=1.8 - - [compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:none"] - - sourceSets.test.resources.srcDirs = ["src/main/java", "src/test/resources", "src/test/java"] - - jar { - manifest.attributes["Implementation-Title"] = subproject.name - manifest.attributes["Implementation-Version"] = subproject.version - - from("${rootProject.projectDir}/src/dist") { - include "license.txt" - include "notice.txt" - into "META-INF" - expand(copyright: new Date().format("yyyy"), version: project.version) - } - } -} - configure(javaProjects) { javaProject -> test { @@ -154,6 +130,30 @@ configure(javaProjects) { javaProject -> } } +subprojects { subproject -> + + apply from: "${rootProject.projectDir}/publish-maven.gradle" + + sourceCompatibility=1.8 + targetCompatibility=1.8 + + [compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:none"] + + sourceSets.test.resources.srcDirs = ["src/main/java", "src/test/resources", "src/test/java"] + + jar { + manifest.attributes["Implementation-Title"] = subproject.name + manifest.attributes["Implementation-Version"] = subproject.version + + from("${rootProject.projectDir}/src/dist") { + include "license.txt" + include "notice.txt" + into "META-INF" + expand(copyright: new Date().format("yyyy"), version: project.version) + } + } +} + configure(rootProject) { description = "Spring Web Flow" @@ -267,7 +267,7 @@ configure(rootProject) { group = "Distribution" archiveBaseName = "spring-webflow" archiveClassifier = "docs" - description = "Builds -${archiveClassifier} archive containing api and reference " + + description = "Builds -${archiveClassifier.get()} archive containing api and reference " + "for deployment at static.springframework.org/spring-webflow/docs." from (api) { @@ -292,9 +292,11 @@ configure(rootProject) { group = "Distribution" archiveBaseName = "spring-webflow" archiveClassifier = "schema" - description = "Builds -${archiveClassifier} archive containing all " + + description = "Builds -${archiveClassifier.get()} archive containing all " + "XSDs for deployment at static.springframework.org/schema." + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + subprojects.each { subproject -> Properties schemas = new Properties() @@ -328,7 +330,7 @@ configure(rootProject) { group = "Distribution" archiveBaseName = "spring-webflow" archiveClassifier = "dist" - description = "Builds -${archiveClassifier} archive, containing all jars and docs, " + + description = "Builds -${archiveClassifier.get()} archive, containing all jars and docs, " + "suitable for community download page." def baseDir = "${archiveBaseName}-${project.version}" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 12d38de6..aa991fce 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/publish-maven.gradle b/publish-maven.gradle index afe09a21..148c521c 100644 --- a/publish-maven.gradle +++ b/publish-maven.gradle @@ -1,55 +1,61 @@ -apply plugin: "maven" +apply plugin: "maven-publish" -install { - repositories.mavenInstaller { - customizePom(pom, project) - } +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + if (project.name != 'spring-js-resources') { + artifact sourcesJar + artifact javadocJar + } + versionMapping { + usage('java-api') { + fromResolutionOf('compileClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } + } + pom { + afterEvaluate { + description = project.description + name = project.description + } + url = "https://github.com/spring-projects/spring-webflow" + organization { + name = "Spring IO" + url = "https://spring.io/projects/spring-webflow" + } + 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-webflow" + connection = "scm:git:git://github.com/spring-projects/spring-webflow" + developerConnection = "scm:git:git://github.com/spring-projects/spring-webflow" + } + developers { + developer { + id = "rstoyanchev" + name = "Rossen Stoyanchev" + email = "rstoyanchev@vmware.com" + } + } + issueManagement { + system = "Jira" + url = "https://jira.spring.io/browse/SWF" + } + } + } + } } -def customizePom(pom, gradleProject) { - pom.whenConfigured { generatedPom -> - // eliminate test-scoped dependencies (no need in maven central poms) - generatedPom.dependencies.removeAll { dep -> - dep.scope == "test" - } - - // 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" - } - - // add all items necessary for maven central publication - generatedPom.project { - name = gradleProject.description - description = gradleProject.description - url = "https://github.com/spring-projects/spring-webflow" - organization { - name = "Spring IO" - url = "https://spring.io/projects/spring-webflow" - } - 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-webflow" - connection = "scm:git:git://github.com/spring-projects/spring-webflow" - developerConnection = "scm:git:git://github.com/spring-projects/spring-webflow" - } - developers { - developer { - id = "rstoyanchev" - name = "Rossen Stoyanchev" - email = "rstoyanchev@pivotal.io" - } - } - issueManagement { - system = "Jira" - url = "https://jira.spring.io/browse/SWF" - } - } - } +// Disable generation of Gradle Module Metadata for compatibility +// with older versions of Spring Web Flow. +tasks.withType(GenerateModuleMetadata) { + enabled = false } diff --git a/spring-binding/spring-binding.gradle b/spring-binding/spring-binding.gradle index 588540f6..7025b44b 100644 --- a/spring-binding/spring-binding.gradle +++ b/spring-binding/spring-binding.gradle @@ -1,15 +1,15 @@ description = "Spring Binding" dependencies { - compile("org.springframework:spring-context") + implementation("org.springframework:spring-context") compileOnly("javax.el:javax.el-api") - testCompile("org.junit.jupiter:junit-jupiter") - testCompile("org.hamcrest:hamcrest") - testCompile("org.easymock:easymock") - testCompile("org.apache.tomcat:tomcat-jasper-el") - testRuntime("org.apache.logging.log4j:log4j-core") - testRuntime("org.apache.logging.log4j:log4j-slf4j-impl") - testRuntime("org.apache.logging.log4j:log4j-jul") + testImplementation("org.junit.jupiter:junit-jupiter") + testImplementation("org.hamcrest:hamcrest") + testImplementation("org.easymock:easymock") + testImplementation("org.apache.tomcat:tomcat-jasper-el") + testRuntimeOnly("org.apache.logging.log4j:log4j-core") + testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl") + testRuntimeOnly("org.apache.logging.log4j:log4j-jul") } \ No newline at end of file diff --git a/spring-faces/spring-faces.gradle b/spring-faces/spring-faces.gradle index 5718d5dc..1e440a34 100644 --- a/spring-faces/spring-faces.gradle +++ b/spring-faces/spring-faces.gradle @@ -1,10 +1,10 @@ description = "Spring Faces" dependencies { - compile(project(":spring-binding")) - compile(project(":spring-webflow")) - compile("org.springframework:spring-web") - compile("org.springframework:spring-webmvc") + implementation(project(":spring-binding")) + implementation(project(":spring-webflow")) + implementation("org.springframework:spring-web") + implementation("org.springframework:spring-webmvc") compileOnly("javax.el:javax.el-api") compileOnly("javax.servlet:javax.servlet-api") @@ -17,16 +17,16 @@ dependencies { optional("org.springframework.security:spring-security-web") optional("org.springframework.security:spring-security-taglibs") - testCompile("org.junit.jupiter:junit-jupiter") - testCompile("org.easymock:easymock") - testCompile("org.apache.myfaces.test:myfaces-test22") - testCompile("org.apache.tomcat:tomcat-jasper-el") - testCompile("org.springframework:spring-test") - testCompile("javax.servlet:javax.servlet-api") - testCompile("com.sun.faces:jsf-api") - testCompile("com.sun.faces:jsf-impl") - testCompile("org.apache.myfaces.core:myfaces-impl") - testRuntime("org.apache.logging.log4j:log4j-core") - testRuntime("org.apache.logging.log4j:log4j-slf4j-impl") - testRuntime("org.apache.logging.log4j:log4j-jul") + testImplementation("org.junit.jupiter:junit-jupiter") + testImplementation("org.easymock:easymock") + testImplementation("org.apache.myfaces.test:myfaces-test22") + testImplementation("org.apache.tomcat:tomcat-jasper-el") + testImplementation("org.springframework:spring-test") + testImplementation("javax.servlet:javax.servlet-api") + testImplementation("com.sun.faces:jsf-api") + testImplementation("com.sun.faces:jsf-impl") + testImplementation("org.apache.myfaces.core:myfaces-impl") + testRuntimeOnly("org.apache.logging.log4j:log4j-core") + testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl") + testRuntimeOnly("org.apache.logging.log4j:log4j-jul") } diff --git a/spring-webflow/spring-webflow.gradle b/spring-webflow/spring-webflow.gradle index fe3dc1f5..dcf53960 100644 --- a/spring-webflow/spring-webflow.gradle +++ b/spring-webflow/spring-webflow.gradle @@ -1,9 +1,9 @@ description = "Spring Web Flow" dependencies { - compile(project(":spring-binding")) - compile("org.springframework:spring-web") - compile("org.springframework:spring-webmvc") + api(project(":spring-binding")) + implementation("org.springframework:spring-web") + implementation("org.springframework:spring-webmvc") compileOnly("javax.el:javax.el-api") compileOnly("javax.servlet:javax.servlet-api") @@ -20,21 +20,21 @@ dependencies { optional("org.apache.tiles:tiles-el") optional("org.apache.tiles:tiles-extras") - testCompile("junit:junit") - testCompile("org.junit.jupiter:junit-jupiter") - testCompile("org.easymock:easymock") - testCompile("org.apache.tomcat:tomcat-jasper-el") - testCompile("org.springframework:spring-aop") - testCompile("org.springframework:spring-jdbc") - testCompile("org.springframework:spring-test") - testCompile("org.hibernate:hibernate-entitymanager") - testCompile("org.hibernate:hibernate-validator") - testCompile("org.hsqldb:hsqldb") - testCompile("javax.servlet.jsp:javax.servlet.jsp-api") - testCompile("javax.servlet:jstl") - testCompile("javax.servlet:javax.servlet-api") - testCompile("javax.validation:validation-api") - testRuntime("org.apache.logging.log4j:log4j-core") - testRuntime("org.apache.logging.log4j:log4j-slf4j-impl") - testRuntime("org.apache.logging.log4j:log4j-jul") + testImplementation("junit:junit") + testImplementation("org.junit.jupiter:junit-jupiter") + testImplementation("org.easymock:easymock") + testImplementation("org.apache.tomcat:tomcat-jasper-el") + testImplementation("org.springframework:spring-aop") + testImplementation("org.springframework:spring-jdbc") + testImplementation("org.springframework:spring-test") + testImplementation("org.hibernate:hibernate-entitymanager") + testImplementation("org.hibernate:hibernate-validator") + testImplementation("org.hsqldb:hsqldb") + testImplementation("javax.servlet.jsp:javax.servlet.jsp-api") + testImplementation("javax.servlet:jstl") + testImplementation("javax.servlet:javax.servlet-api") + testImplementation("javax.validation:validation-api") + testRuntimeOnly("org.apache.logging.log4j:log4j-core") + testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl") + testRuntimeOnly("org.apache.logging.log4j:log4j-jul") } \ No newline at end of file