Remove Gradle propdeps plugin

This commit removes the propdeps plugin.
"provided" configurations are replaced with "compileOnly", "testCompile"
configurations.
The "optional" configuration supported by propdeps is now replaced by a
local Gradle plugin defining a specific configuration for that.

As a result of that change, optional/provided dependencies are not
published with the POMs anymore.
This commit is contained in:
Brian Clozel
2020-04-30 16:40:51 +02:00
committed by Rossen Stoyanchev
parent 2f2c2e0313
commit 92ed854f97
10 changed files with 69 additions and 17 deletions

View File

@@ -3,7 +3,6 @@ buildscript {
maven { url "https://repo.spring.io/plugins-release" }
}
dependencies {
classpath("io.spring.gradle:propdeps-plugin:0.0.9.RELEASE")
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.9.2")
classpath "org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16"
}
@@ -24,9 +23,9 @@ ext {
allprojects {
group = "org.springframework.webflow"
apply plugin: "io.spring.dependency-management"
apply plugin: "propdeps"
apply plugin: "java"
apply plugin: "io.spring.dependency-management"
apply plugin: "org.springframework.build.optional-dependencies"
apply from: "${rootProject.projectDir}/ide.gradle"
dependencyManagement {
@@ -72,9 +71,7 @@ allprojects {
}
dependency "org.slf4j:slf4j-api:1.7.30"
dependency("junit:junit:4.13") {
exclude group: "org.hamcrest", name: "hamcrest-core"
}
dependency("junit:junit:4.13")
dependency "org.easymock:easymock:4.2"
dependency "org.hamcrest:hamcrest:2.1"
dependency "org.apache.tomcat:tomcat-jasper-el:9.0.34"

26
buildSrc/README.md Normal file
View File

@@ -0,0 +1,26 @@
# Spring Webflow Build
This folder contains the custom plugins and conventions for the Spring Webflow build.
They are declared in the `build.gradle` file in this folder.
## Build Conventions
### Compiler conventions
The `org.springframework.build.compile` plugin applies the Java compiler conventions to the build.
By default, the build compiles sources with Java `1.8` source and target compatibility.
You can test a different source compatibility version on the CLI with a project property like:
```
./gradlew test -PjavaSourceVersion=11
```
## Build Plugins
## Optional dependencies
The `org.springframework.build.optional-dependencies` plugin creates a new `optional`
Gradle configuration - it adds the dependencies to the project's compile and runtime classpath
but doesn't affect the classpath of dependent projects.
This plugin does not provide a `provided` configuration, as the native `compileOnly` and `testCompileOnly`
configurations are preferred.

17
buildSrc/build.gradle Normal file
View File

@@ -0,0 +1,17 @@
plugins {
id 'java-gradle-plugin'
}
repositories {
mavenCentral()
gradlePluginPortal()
}
gradlePlugin {
plugins {
optionalDependenciesPlugin {
id = "org.springframework.build.optional-dependencies"
implementationClass = "org.springframework.build.optional.OptionalDependenciesPlugin"
}
}
}

View File

@@ -0,0 +1 @@
org.gradle.caching=true

0
buildSrc/settings.gradle Normal file
View File

View File

@@ -1,9 +1,7 @@
import org.gradle.plugins.ide.eclipse.model.ProjectDependency
import org.gradle.plugins.ide.eclipse.model.SourceFolder
apply plugin: "propdeps-eclipse"
apply plugin: "propdeps-idea"
apply plugin: "eclipse"
eclipse.jdt {
sourceCompatibility = 1.8

View File

@@ -1,4 +1,4 @@
apply plugin: "propdeps-maven"
apply plugin: "maven"
install {
repositories.mavenInstaller {

View File

@@ -4,6 +4,7 @@ dependencies {
compile("org.springframework:spring-context")
compileOnly("javax.el:javax.el-api")
testCompile("org.junit.jupiter:junit-jupiter")
testCompile("org.hamcrest:hamcrest")
testCompile("org.easymock:easymock")

View File

@@ -5,20 +5,27 @@ dependencies {
compile(project(":spring-webflow"))
compile("org.springframework:spring-web")
compile("org.springframework:spring-webmvc")
compileOnly("javax.el:javax.el-api")
provided("javax.servlet:javax.servlet-api")
provided("com.sun.faces:jsf-api")
provided("com.sun.faces:jsf-impl")
provided("org.apache.myfaces.core:myfaces-impl")
compileOnly("javax.servlet:javax.servlet-api")
compileOnly("com.sun.faces:jsf-api")
compileOnly("com.sun.faces:jsf-impl")
compileOnly("org.apache.myfaces.core:myfaces-impl")
optional("com.sun.facelets:jsf-facelets")
optional("org.springframework.security:spring-security-core")
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")

View File

@@ -4,8 +4,11 @@ dependencies {
compile(project(":spring-binding"))
compile("org.springframework:spring-web")
compile("org.springframework:spring-webmvc")
compileOnly("javax.el:javax.el-api")
provided("javax.servlet:javax.servlet-api")
compileOnly("javax.servlet:javax.servlet-api")
compileOnly("junit:junit")
optional("org.hibernate:hibernate-core")
optional("org.springframework.security:spring-security-core")
optional("org.springframework:spring-orm")
@@ -16,19 +19,21 @@ dependencies {
optional("org.apache.tiles:tiles-jsp")
optional("org.apache.tiles:tiles-el")
optional("org.apache.tiles:tiles-extras")
provided("junit:junit")
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("javax.validation:validation-api")
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")