diff --git a/build.gradle b/build.gradle index d44b82d4..bffa429d 100644 --- a/build.gradle +++ b/build.gradle @@ -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" diff --git a/buildSrc/README.md b/buildSrc/README.md new file mode 100644 index 00000000..7cdab4b4 --- /dev/null +++ b/buildSrc/README.md @@ -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. \ No newline at end of file diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle new file mode 100644 index 00000000..ba749319 --- /dev/null +++ b/buildSrc/build.gradle @@ -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" + } + } +} diff --git a/buildSrc/gradle.properties b/buildSrc/gradle.properties new file mode 100644 index 00000000..16089002 --- /dev/null +++ b/buildSrc/gradle.properties @@ -0,0 +1 @@ +org.gradle.caching=true diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle new file mode 100644 index 00000000..e69de29b diff --git a/ide.gradle b/ide.gradle index 10ee361e..1778f112 100644 --- a/ide.gradle +++ b/ide.gradle @@ -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 diff --git a/publish-maven.gradle b/publish-maven.gradle index f9ae0728..e8b070aa 100644 --- a/publish-maven.gradle +++ b/publish-maven.gradle @@ -1,4 +1,4 @@ -apply plugin: "propdeps-maven" +apply plugin: "maven" install { repositories.mavenInstaller { diff --git a/spring-binding/spring-binding.gradle b/spring-binding/spring-binding.gradle index 9d837b1d..588540f6 100644 --- a/spring-binding/spring-binding.gradle +++ b/spring-binding/spring-binding.gradle @@ -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") diff --git a/spring-faces/spring-faces.gradle b/spring-faces/spring-faces.gradle index b2150249..5718d5dc 100644 --- a/spring-faces/spring-faces.gradle +++ b/spring-faces/spring-faces.gradle @@ -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") diff --git a/spring-webflow/spring-webflow.gradle b/spring-webflow/spring-webflow.gradle index 1afcee8b..fe3dc1f5 100644 --- a/spring-webflow/spring-webflow.gradle +++ b/spring-webflow/spring-webflow.gradle @@ -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")