Upgrade to Gradle 7.4.2 and use java-library plugin

Align with main branch
This commit is contained in:
Rossen Stoyanchev
2022-08-01 13:52:22 +03:00
parent 0d2130244e
commit 9fd8d3eccd
6 changed files with 135 additions and 127 deletions

View File

@@ -6,9 +6,9 @@ buildscript {
plugins { plugins {
id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false 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.pdf' version '3.3.2'
id 'org.asciidoctor.jvm.gems' version '3.3.0' id 'org.asciidoctor.jvm.gems' version '3.3.2'
id 'org.asciidoctor.jvm.convert' version '3.3.0' id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'de.undercouch.download' version '4.1.2' id 'de.undercouch.download' version '4.1.2'
} }
@@ -23,7 +23,7 @@ ext {
allprojects { allprojects {
group = "org.springframework.webflow" group = "org.springframework.webflow"
apply plugin: "java" apply plugin: "java-library"
apply plugin: "io.spring.dependency-management" apply plugin: "io.spring.dependency-management"
apply plugin: "org.springframework.build.optional-dependencies" apply plugin: "org.springframework.build.optional-dependencies"
apply from: "${rootProject.projectDir}/ide.gradle" 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 -> configure(javaProjects) { javaProject ->
test { 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) { configure(rootProject) {
description = "Spring Web Flow" description = "Spring Web Flow"
@@ -267,7 +267,7 @@ configure(rootProject) {
group = "Distribution" group = "Distribution"
archiveBaseName = "spring-webflow" archiveBaseName = "spring-webflow"
archiveClassifier = "docs" 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." "for deployment at static.springframework.org/spring-webflow/docs."
from (api) { from (api) {
@@ -292,9 +292,11 @@ configure(rootProject) {
group = "Distribution" group = "Distribution"
archiveBaseName = "spring-webflow" archiveBaseName = "spring-webflow"
archiveClassifier = "schema" archiveClassifier = "schema"
description = "Builds -${archiveClassifier} archive containing all " + description = "Builds -${archiveClassifier.get()} archive containing all " +
"XSDs for deployment at static.springframework.org/schema." "XSDs for deployment at static.springframework.org/schema."
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
subprojects.each { subproject -> subprojects.each { subproject ->
Properties schemas = new Properties() Properties schemas = new Properties()
@@ -328,7 +330,7 @@ configure(rootProject) {
group = "Distribution" group = "Distribution"
archiveBaseName = "spring-webflow" archiveBaseName = "spring-webflow"
archiveClassifier = "dist" 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." "suitable for community download page."
def baseDir = "${archiveBaseName}-${project.version}" def baseDir = "${archiveBaseName}-${project.version}"

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists 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 zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@@ -1,55 +1,61 @@
apply plugin: "maven" apply plugin: "maven-publish"
install { publishing {
repositories.mavenInstaller { publications {
customizePom(pom, project) 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) { // Disable generation of Gradle Module Metadata for compatibility
pom.whenConfigured { generatedPom -> // with older versions of Spring Web Flow.
// eliminate test-scoped dependencies (no need in maven central poms) tasks.withType(GenerateModuleMetadata) {
generatedPom.dependencies.removeAll { dep -> enabled = false
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"
}
}
}
} }

View File

@@ -1,15 +1,15 @@
description = "Spring Binding" description = "Spring Binding"
dependencies { dependencies {
compile("org.springframework:spring-context") implementation("org.springframework:spring-context")
compileOnly("javax.el:javax.el-api") compileOnly("javax.el:javax.el-api")
testCompile("org.junit.jupiter:junit-jupiter") testImplementation("org.junit.jupiter:junit-jupiter")
testCompile("org.hamcrest:hamcrest") testImplementation("org.hamcrest:hamcrest")
testCompile("org.easymock:easymock") testImplementation("org.easymock:easymock")
testCompile("org.apache.tomcat:tomcat-jasper-el") testImplementation("org.apache.tomcat:tomcat-jasper-el")
testRuntime("org.apache.logging.log4j:log4j-core") testRuntimeOnly("org.apache.logging.log4j:log4j-core")
testRuntime("org.apache.logging.log4j:log4j-slf4j-impl") testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl")
testRuntime("org.apache.logging.log4j:log4j-jul") testRuntimeOnly("org.apache.logging.log4j:log4j-jul")
} }

View File

@@ -1,10 +1,10 @@
description = "Spring Faces" description = "Spring Faces"
dependencies { dependencies {
compile(project(":spring-binding")) implementation(project(":spring-binding"))
compile(project(":spring-webflow")) implementation(project(":spring-webflow"))
compile("org.springframework:spring-web") implementation("org.springframework:spring-web")
compile("org.springframework:spring-webmvc") implementation("org.springframework:spring-webmvc")
compileOnly("javax.el:javax.el-api") compileOnly("javax.el:javax.el-api")
compileOnly("javax.servlet:javax.servlet-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-web")
optional("org.springframework.security:spring-security-taglibs") optional("org.springframework.security:spring-security-taglibs")
testCompile("org.junit.jupiter:junit-jupiter") testImplementation("org.junit.jupiter:junit-jupiter")
testCompile("org.easymock:easymock") testImplementation("org.easymock:easymock")
testCompile("org.apache.myfaces.test:myfaces-test22") testImplementation("org.apache.myfaces.test:myfaces-test22")
testCompile("org.apache.tomcat:tomcat-jasper-el") testImplementation("org.apache.tomcat:tomcat-jasper-el")
testCompile("org.springframework:spring-test") testImplementation("org.springframework:spring-test")
testCompile("javax.servlet:javax.servlet-api") testImplementation("javax.servlet:javax.servlet-api")
testCompile("com.sun.faces:jsf-api") testImplementation("com.sun.faces:jsf-api")
testCompile("com.sun.faces:jsf-impl") testImplementation("com.sun.faces:jsf-impl")
testCompile("org.apache.myfaces.core:myfaces-impl") testImplementation("org.apache.myfaces.core:myfaces-impl")
testRuntime("org.apache.logging.log4j:log4j-core") testRuntimeOnly("org.apache.logging.log4j:log4j-core")
testRuntime("org.apache.logging.log4j:log4j-slf4j-impl") testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl")
testRuntime("org.apache.logging.log4j:log4j-jul") testRuntimeOnly("org.apache.logging.log4j:log4j-jul")
} }

View File

@@ -1,9 +1,9 @@
description = "Spring Web Flow" description = "Spring Web Flow"
dependencies { dependencies {
compile(project(":spring-binding")) api(project(":spring-binding"))
compile("org.springframework:spring-web") implementation("org.springframework:spring-web")
compile("org.springframework:spring-webmvc") implementation("org.springframework:spring-webmvc")
compileOnly("javax.el:javax.el-api") compileOnly("javax.el:javax.el-api")
compileOnly("javax.servlet:javax.servlet-api") compileOnly("javax.servlet:javax.servlet-api")
@@ -20,21 +20,21 @@ dependencies {
optional("org.apache.tiles:tiles-el") optional("org.apache.tiles:tiles-el")
optional("org.apache.tiles:tiles-extras") optional("org.apache.tiles:tiles-extras")
testCompile("junit:junit") testImplementation("junit:junit")
testCompile("org.junit.jupiter:junit-jupiter") testImplementation("org.junit.jupiter:junit-jupiter")
testCompile("org.easymock:easymock") testImplementation("org.easymock:easymock")
testCompile("org.apache.tomcat:tomcat-jasper-el") testImplementation("org.apache.tomcat:tomcat-jasper-el")
testCompile("org.springframework:spring-aop") testImplementation("org.springframework:spring-aop")
testCompile("org.springframework:spring-jdbc") testImplementation("org.springframework:spring-jdbc")
testCompile("org.springframework:spring-test") testImplementation("org.springframework:spring-test")
testCompile("org.hibernate:hibernate-entitymanager") testImplementation("org.hibernate:hibernate-entitymanager")
testCompile("org.hibernate:hibernate-validator") testImplementation("org.hibernate:hibernate-validator")
testCompile("org.hsqldb:hsqldb") testImplementation("org.hsqldb:hsqldb")
testCompile("javax.servlet.jsp:javax.servlet.jsp-api") testImplementation("javax.servlet.jsp:javax.servlet.jsp-api")
testCompile("javax.servlet:jstl") testImplementation("javax.servlet:jstl")
testCompile("javax.servlet:javax.servlet-api") testImplementation("javax.servlet:javax.servlet-api")
testCompile("javax.validation:validation-api") testImplementation("javax.validation:validation-api")
testRuntime("org.apache.logging.log4j:log4j-core") testRuntimeOnly("org.apache.logging.log4j:log4j-core")
testRuntime("org.apache.logging.log4j:log4j-slf4j-impl") testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl")
testRuntime("org.apache.logging.log4j:log4j-jul") testRuntimeOnly("org.apache.logging.log4j:log4j-jul")
} }