diff --git a/acl/acl.gradle b/acl/acl.gradle
deleted file mode 100644
index eacbc7f825..0000000000
--- a/acl/acl.gradle
+++ /dev/null
@@ -1,19 +0,0 @@
-// Acl Module build file
-
-dependencies {
- compile project(':spring-security-core'),
- springCoreDependency,
- 'aopalliance:aopalliance:1.0',
- "org.springframework:spring-aop:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-tx:$springVersion",
- "org.springframework:spring-jdbc:$springVersion"
-
- optional "net.sf.ehcache:ehcache:$ehcacheVersion"
-
- testCompile "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-context-support:$springVersion",
- "org.springframework:spring-test:$springVersion"
-
- testRuntime "org.hsqldb:hsqldb:$hsqlVersion"
-}
\ No newline at end of file
diff --git a/acl/spring-security-acl.gradle b/acl/spring-security-acl.gradle
new file mode 100644
index 0000000000..31b5de0a57
--- /dev/null
+++ b/acl/spring-security-acl.gradle
@@ -0,0 +1,19 @@
+apply plugin: 'io.spring.convention.spring-module'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile 'aopalliance:aopalliance'
+ compile 'org.springframework:spring-aop'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-core'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-tx'
+
+ optional 'net.sf.ehcache:ehcache'
+
+ testCompile 'org.springframework:spring-beans'
+ testCompile 'org.springframework:spring-context-support'
+ testCompile 'org.springframework:spring-test'
+
+ testRuntime 'org.hsqldb:hsqldb'
+}
diff --git a/aspects/aspects.gradle b/aspects/aspects.gradle
deleted file mode 100644
index d1fdc61ca9..0000000000
--- a/aspects/aspects.gradle
+++ /dev/null
@@ -1,10 +0,0 @@
-
-dependencies {
- compile project(':spring-security-core'),
- springCoreDependency,
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-context:$springVersion"
-
- testCompile 'aopalliance:aopalliance:1.0',
- "org.springframework:spring-aop:$springVersion"
-}
\ No newline at end of file
diff --git a/aspects/spring-security-aspects.gradle b/aspects/spring-security-aspects.gradle
new file mode 100644
index 0000000000..564a3577a4
--- /dev/null
+++ b/aspects/spring-security-aspects.gradle
@@ -0,0 +1,12 @@
+apply plugin: 'io.spring.convention.spring-module'
+apply plugin: 'aspectj'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-core'
+
+ testCompile 'aopalliance:aopalliance'
+ testCompile 'org.springframework:spring-aop'
+}
diff --git a/bom/build.gradle b/bom/build.gradle
deleted file mode 100644
index a5bc2668fa..0000000000
--- a/bom/build.gradle
+++ /dev/null
@@ -1,9 +0,0 @@
-apply plugin: 'maven-bom'
-apply from: "$rootDir/gradle/maven-deployment.gradle"
-
-generatePom.enabled = false
-sonarqube.skipProject = true
-
-mavenBom {
- projects = coreModuleProjects
-}
\ No newline at end of file
diff --git a/bom/spring-security-bom.gradle b/bom/spring-security-bom.gradle
new file mode 100644
index 0000000000..e599aeeec4
--- /dev/null
+++ b/bom/spring-security-bom.gradle
@@ -0,0 +1,9 @@
+apply plugin: 'maven-bom'
+
+sonarqube.skipProject = true
+
+project.rootProject.allprojects.each { p ->
+ p.plugins.withType(io.spring.gradle.convention.SpringMavenPlugin) {
+ project.mavenBom.projects.add(p)
+ }
+}
diff --git a/build.gradle b/build.gradle
index 8b73605ab7..aafeb65426 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,192 +1,18 @@
buildscript {
- repositories {
- maven { url "https://repo.spring.io/plugins-release" }
- maven { url "https://repo.spring.io/plugins-snapshot" }
- }
dependencies {
- classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
- classpath("io.spring.gradle:spring-io-plugin:0.0.6.RELEASE")
- classpath("com.bmuschko:gradle-tomcat-plugin:2.2.4")
- classpath('me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1')
- classpath('org.asciidoctor:asciidoctor-gradle-plugin:1.5.1')
- classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
- classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.0.BUILD-SNAPSHOT")
+ classpath 'io.spring.gradle:spring-gradle-build-conventions:1.0-SNAPSHOT'
+ classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
+ }
+ repositories {
+ maven { url 'https://repo.spring.io/libs-snapshot' }
+ maven { url 'https://repo.spring.io/plugins-release' }
}
}
+apply plugin: 'io.spring.convention.root'
-plugins {
- id "org.sonarqube" version "2.1-rc1"
-}
-
-apply plugin: 'base'
-
+group = 'org.springframework.security'
description = 'Spring Security'
-allprojects {
- apply plugin: 'idea'
- apply plugin: 'eclipse'
-
- ext.releaseBuild = version.endsWith('RELEASE')
- ext.snapshotBuild = version.endsWith('SNAPSHOT')
- ext.springVersion = '4.3.5.RELEASE'
- ext.springLdapVersion = '2.2.0.RELEASE'
-
- group = 'org.springframework.security'
-
- repositories {
- mavenCentral()
- maven { url "https://repo.spring.io/libs-snapshot" }
- maven { url "https://repo.spring.io/plugins-release" }
- maven { url "http://repo.terracotta.org/maven2/" }
- }
-
-}
-
-sonarqube {
- properties {
- property "sonar.java.coveragePlugin", "jacoco"
- property "sonar.projectName", "Spring Security"
- property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
- property "sonar.links.homepage", 'https://www.springsource.org/spring-security'
- property "sonar.links.ci", 'https://build.springsource.org/browse/SEC-B32X'
- property "sonar.links.issue", 'https://jira.springsource.org/browse/SEC'
- property "sonar.links.scm", 'https://github.com/SpringSource/spring-security'
- property "sonar.links.scm_dev", 'https://github.com/SpringSource/spring-security.git'
- property "sonar.java.coveragePlugin", "jacoco"
- }
-}
-
-// Set up different subproject lists for individual configuration
-ext.javaProjects = subprojects.findAll { project -> project.name != 'docs' && project.name != 'manual' && project.name != 'guides' && project.name != 'spring-security-bom' }
-ext.sampleProjects = subprojects.findAll { project -> project.name.startsWith('spring-security-samples') }
-ext.itestProjects = subprojects.findAll { project -> project.name.startsWith('itest') }
-ext.coreModuleProjects = javaProjects - sampleProjects - itestProjects
-ext.aspectjProjects = [project(':spring-security-aspects'), project(':spring-security-samples-xml-aspectj'), project(':spring-security-samples-javaconfig-aspectj')]
-
-configure(allprojects - javaProjects) {
- task afterEclipseImport {
- ext.srcFile = file('.classpath')
- inputs.file srcFile
- outputs.dir srcFile
-
- onlyIf { !srcFile.exists() }
-
- doLast {
- srcFile << """
-
-
-
-
-"""
- }
- }
-}
-
-configure(subprojects - coreModuleProjects - project(':spring-security-samples-javaconfig-messages') - project(':spring-security-bom')) {
- tasks.findByPath("artifactoryPublish")?.enabled = false
- sonarqube {
- skipProject = true
- }
-}
-
-configure(javaProjects) {
- ext.TOMCAT_GRADLE = "$rootDir/gradle/tomcat.gradle"
- ext.WAR_SAMPLE_GRADLE = "$rootDir/gradle/war-sample.gradle"
- ext.BOOT_SAMPLE_GRADLE = "$rootDir/gradle/boot-sample.gradle"
- apply from: "$rootDir/gradle/javaprojects.gradle"
- if(!project.name.contains('gae')) {
- apply from: "$rootDir/gradle/checkstyle.gradle"
- }
- apply from: "$rootDir/gradle/ide.gradle"
- apply from: "$rootDir/gradle/release-checks.gradle"
- apply from: "$rootDir/gradle/maven-deployment.gradle"
-}
-
-configure(coreModuleProjects) {
- apply plugin: 'emma'
- apply plugin: 'spring-io'
-
- ext.springIoVersion = project.hasProperty('platformVersion') ? platformVersion : 'Brussels-SR1'
-
- configurations {
- jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo
- }
-
- dependencyManagement {
- springIoTestRuntime {
- imports {
- mavenBom("io.spring.platform:platform-bom:${springIoVersion}") {
- bomProperties([
- 'mockito.version': '1.10.19'
- ])
- }
- }
- }
- }
- dependencies {
- jacoco "org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime"
- }
- test {
- jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=${project.group}.*"
- }
- integrationTest {
- jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=${project.group}.*"
- }
-}
-
-configure (aspectjProjects) {
- apply plugin: 'java'
- apply plugin: 'aspectj'
-}
-
-task coreBuild {
- dependsOn coreModuleProjects*.tasks*.matching { task -> task.name == 'build' }
-}
-
-task coreInstall {
- dependsOn coreModuleProjects*.tasks*.matching { task -> task.name == 'install' }
-}
-
-// Task for creating the distro zip
-
-task dist(type: Zip) {
- dependsOn { subprojects*.tasks*.matching { task -> task.name.endsWith('generatePom') } }
- classifier = 'dist'
-
- evaluationDependsOn(':docs')
- evaluationDependsOn(':docs:manual')
-
- def zipRootDir = "${project.name}-$version"
- into(zipRootDir) {
- from(rootDir) {
- include '*.adoc'
- include '*.txt'
- }
- into('docs') {
- with(project(':docs').apiSpec)
- with(project(':docs:manual').spec)
- with(project(':docs:guides').spec)
- }
- project.coreModuleProjects*.tasks*.withType(AbstractArchiveTask).flatten().each{ archiveTask ->
- if(archiveTask!=dist){
- into("$zipRootDir/dist") {
- from archiveTask.outputs.files
- }
- }
- }
- sampleProjects.each { project->
- into("$zipRootDir/samples/$project.name") {
- from(project.projectDir) {
- include "src/main/**"
- include "pom.xml"
- }
- }
- }
- }
-}
-
-artifacts {
- archives dist
- archives project(':docs').docsZip
- archives project(':docs').schemaZip
-}
+ext.snapshotBuild = version.contains("SNAPSHOT")
+ext.releaseBuild = version.contains("SNAPSHOT")
+ext.milestoneBuild = !(snapshotBuild || releaseBuild)
diff --git a/buildSrc/src/main/groovy/MavenBomTask.groovy b/buildSrc/src/main/groovy/MavenBomTask.groovy
index 171dd77892..d69a6edadd 100644
--- a/buildSrc/src/main/groovy/MavenBomTask.groovy
+++ b/buildSrc/src/main/groovy/MavenBomTask.groovy
@@ -6,7 +6,7 @@ import org.gradle.api.tasks.*
public class MavenBomTask extends DefaultTask {
- Set projects
+ Set projects = []
File bomFile
@@ -52,4 +52,4 @@ public class MavenBomTask extends DefaultTask {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/buildSrc/src/main/groovy/aspectj/AspectJPlugin.groovy b/buildSrc/src/main/groovy/aspectj/AspectJPlugin.groovy
index fa61e5faad..8f452689dd 100644
--- a/buildSrc/src/main/groovy/aspectj/AspectJPlugin.groovy
+++ b/buildSrc/src/main/groovy/aspectj/AspectJPlugin.groovy
@@ -26,15 +26,11 @@ class AspectJPlugin implements Plugin {
void apply(Project project) {
project.plugins.apply(JavaPlugin)
- if (!project.hasProperty('aspectjVersion')) {
- throw new GradleException("You must set the property 'aspectjVersion' before applying the aspectj plugin")
- }
-
if (project.configurations.findByName('ajtools') == null) {
project.configurations.create('ajtools')
project.dependencies {
- ajtools "org.aspectj:aspectjtools:${project.aspectjVersion}"
- optional "org.aspectj:aspectjrt:${project.aspectjVersion}"
+ ajtools "org.aspectj:aspectjtools"
+ optional "org.aspectj:aspectjrt"
}
}
diff --git a/cas/cas.gradle b/cas/cas.gradle
deleted file mode 100644
index 4e8f2bac47..0000000000
--- a/cas/cas.gradle
+++ /dev/null
@@ -1,17 +0,0 @@
-
-dependencies {
- compile project(':spring-security-core'),
- project(':spring-security-web'),
- springCoreDependency,
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-web:$springVersion",
- "org.jasig.cas.client:cas-client-core:$casClientVersion"
-
- optional "net.sf.ehcache:ehcache:$ehcacheVersion",
- "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
-
- testCompile "org.skyscreamer:jsonassert:$jsonassertVersion"
-
- provided "javax.servlet:javax.servlet-api:$servletApiVersion"
-}
diff --git a/cas/spring-security-cas.gradle b/cas/spring-security-cas.gradle
new file mode 100644
index 0000000000..b135885690
--- /dev/null
+++ b/cas/spring-security-cas.gradle
@@ -0,0 +1,18 @@
+apply plugin: 'io.spring.convention.spring-module'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile project(':spring-security-web')
+ compile 'org.jasig.cas.client:cas-client-core'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-core'
+ compile 'org.springframework:spring-web'
+
+ optional 'com.fasterxml.jackson.core:jackson-databind'
+ optional 'net.sf.ehcache:ehcache'
+
+ provided 'javax.servlet:javax.servlet-api'
+
+ testCompile 'org.skyscreamer:jsonassert'
+}
diff --git a/config/config.gradle b/config/config.gradle
deleted file mode 100644
index 56be46286c..0000000000
--- a/config/config.gradle
+++ /dev/null
@@ -1,77 +0,0 @@
-import javax.security.auth.login.ConfigurationSpi;
-
-// Config Module build file
-
-apply plugin: 'groovy'
-apply plugin: 'trang'
-
-compileTestJava.dependsOn(':spring-security-core:compileTestJava')
-
-dependencies {
- // NB: Don't add other compile time dependencies to the config module as this breaks tooling
- compile project(':spring-security-core'),
- springCoreDependency,
- 'aopalliance:aopalliance:1.0',
- "org.springframework:spring-aop:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-beans:$springVersion"
-
- optional project(':spring-security-web'),
- project(':spring-security-ldap'),
- project(':spring-security-openid'),
- project(':spring-security-messaging'),
- "org.springframework:spring-web:$springVersion",
- "org.springframework:spring-websocket:$springVersion",
- "org.springframework:spring-webmvc:$springVersion",
- "org.aspectj:aspectjweaver:$aspectjVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.springframework:spring-tx:$springVersion"
-
- provided "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- testCompile project(':spring-security-cas'),
- project(':spring-security-core').sourceSets.test.output,
- project(':spring-security-aspects'),
- 'javax.annotation:jsr250-api:1.0',
- "org.springframework.ldap:spring-ldap-core:$springLdapVersion",
- "org.springframework:spring-expression:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.springframework:spring-orm:$springVersion",
- "org.springframework:spring-tx:$springVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "org.eclipse.persistence:javax.persistence:$javaPersistenceVersion",
- "org.hibernate:hibernate-entitymanager:$hibernateVersion",
- "org.codehaus.groovy:groovy-all:$groovyVersion",
- "org.apache.directory.server:apacheds-core:$apacheDsVersion",
- "org.apache.directory.server:apacheds-core-entry:$apacheDsVersion",
- "org.apache.directory.server:apacheds-protocol-shared:$apacheDsVersion",
- "org.apache.directory.server:apacheds-protocol-ldap:$apacheDsVersion",
- "org.apache.directory.server:apacheds-server-jndi:$apacheDsVersion",
- 'org.apache.directory.shared:shared-ldap:0.9.15',
- 'ldapsdk:ldapsdk:4.1',
- powerMockDependencies,
- "org.hsqldb:hsqldb:$hsqlVersion",
- spockDependencies
-
- testCompile('org.openid4java:openid4java-nodeps:0.9.6') {
- exclude group: 'com.google.code.guice', module: 'guice'
- }
- testCompile("org.springframework.data:spring-data-jpa:$springDataJpaVersion") {
- exclude group: 'org.aspectj', module: 'aspectjrt'
- }
-
- testRuntime "org.hsqldb:hsqldb:$hsqlVersion",
- "cglib:cglib-nodep:$cglibVersion"
-}
-
-test {
- inputs.file file("$rootDir/docs/manual/src/docbook/appendix-namespace.xml")
-}
-
-rncToXsd {
- rncDir = file('src/main/resources/org/springframework/security/config/')
- xsdDir = rncDir
- xslFile = new File(rncDir, 'spring-security.xsl')
-}
-
-build.dependsOn rncToXsd
\ No newline at end of file
diff --git a/config/spring-security-config.gradle b/config/spring-security-config.gradle
new file mode 100644
index 0000000000..559a9d3f8f
--- /dev/null
+++ b/config/spring-security-config.gradle
@@ -0,0 +1,65 @@
+apply plugin: 'io.spring.convention.spring-module'
+apply plugin: 'trang'
+
+dependencies {
+ // NB: Don't add other compile time dependencies to the config module as this breaks tooling
+ compile project(':spring-security-core')
+ compile 'aopalliance:aopalliance:1.0'
+ compile 'org.springframework:spring-aop'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-core'
+
+ optional project(':spring-security-ldap')
+ optional project(':spring-security-messaging')
+ optional project(':spring-security-openid')
+ optional project(':spring-security-web')
+ optional 'org.aspectj:aspectjweaver'
+ optional 'org.springframework:spring-jdbc'
+ optional 'org.springframework:spring-tx'
+ optional 'org.springframework:spring-webmvc'
+ optional'org.springframework:spring-web'
+ optional'org.springframework:spring-websocket'
+
+ provided 'javax.servlet:javax.servlet-api'
+
+ testCompile project(':spring-security-aspects')
+ testCompile project(':spring-security-cas')
+ testCompile project(path : ':spring-security-core', configuration : 'tests')
+ testCompile apachedsDependencies
+ testCompile powerMockDependencies
+ testCompile spockDependencies
+ testCompile 'javax.annotation:jsr250-api:1.0'
+ testCompile 'ldapsdk:ldapsdk:4.1'
+ testCompile 'org.codehaus.groovy:groovy-all'
+ testCompile 'org.eclipse.persistence:javax.persistence'
+ testCompile 'org.hibernate:hibernate-entitymanager'
+ testCompile 'org.hsqldb:hsqldb'
+ testCompile ('org.openid4java:openid4java-nodeps') {
+ exclude group: 'com.google.code.guice', module: 'guice'
+ }
+ testCompile 'org.slf4j:jcl-over-slf4j'
+ testCompile 'org.springframework.ldap:spring-ldap-core'
+ testCompile 'org.springframework:spring-expression'
+ testCompile 'org.springframework:spring-jdbc'
+ testCompile 'org.springframework:spring-orm'
+ testCompile 'org.springframework:spring-tx'
+ testCompile ('org.springframework.data:spring-data-jpa') {
+ exclude group: 'org.aspectj', module: 'aspectjrt'
+ }
+
+ testRuntime 'cglib:cglib-nodep'
+ testRuntime 'org.hsqldb:hsqldb'
+}
+
+test {
+ inputs.file file("$rootDir/docs/manual/src/docbook/appendix-namespace.xml")
+}
+
+rncToXsd {
+ rncDir = file('src/main/resources/org/springframework/security/config/')
+ xsdDir = rncDir
+ xslFile = new File(rncDir, 'spring-security.xsl')
+}
+
+build.dependsOn rncToXsd
diff --git a/core/core.gradle b/core/core.gradle
deleted file mode 100644
index 95ebe7f2bc..0000000000
--- a/core/core.gradle
+++ /dev/null
@@ -1,53 +0,0 @@
-// Core build file
-
-// We don't define a module dependency on crypto to avoid creating a transitive dependency
-def cryptoProject = project(':spring-security-crypto')
-def cryptoClasses = cryptoProject.sourceSets.main.output
-
-configurations {
- included
-
- compile.extendsFrom included
-
- testCompile.exclude group: 'org.mockito', module: 'mockito-all'
-}
-
-dependencies {
- compile springCoreDependency,
- 'aopalliance:aopalliance:1.0',
- "org.springframework:spring-aop:$springVersion",
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-expression:$springVersion"
-
- optional "net.sf.ehcache:ehcache:$ehcacheVersion",
- 'javax.annotation:jsr250-api:1.0',
- "org.aspectj:aspectjrt:$aspectjVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.springframework:spring-tx:$springVersion",
- "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
-
- included cryptoProject
-
- testCompile "commons-collections:commons-collections:$commonsCollectionsVersion",
- "org.springframework:spring-test:$springVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- powerMockDependencies,
- "org.skyscreamer:jsonassert:$jsonassertVersion"
-
- testRuntime "org.hsqldb:hsqldb:$hsqlVersion"
-}
-
-classes.doLast {
- copy {
- from cryptoClasses
- into sourceSets.main.output.classesDir
- }
-}
-
-sourceJar.from cryptoProject.sourceSets.main.java
-
-configure(project.tasks.withType(Test)) {
- systemProperties['springSecurityVersion'] = version
- systemProperties['springVersion'] = springVersion
-}
\ No newline at end of file
diff --git a/core/spring-security-core.gradle b/core/spring-security-core.gradle
new file mode 100644
index 0000000000..593fe43c8e
--- /dev/null
+++ b/core/spring-security-core.gradle
@@ -0,0 +1,69 @@
+apply plugin: 'io.spring.convention.spring-module'
+
+def includeProject = project(':spring-security-crypto')
+
+configurations {
+ tests
+ published.extendsFrom tests, archives
+
+ included
+ compile.extendsFrom included
+}
+
+dependencies {
+ compile 'aopalliance:aopalliance'
+ compile 'commons-logging:commons-logging'
+ compile 'org.springframework:spring-aop'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-core'
+ compile 'org.springframework:spring-expression'
+
+ included includeProject
+
+ optional 'com.fasterxml.jackson.core:jackson-databind'
+ optional 'javax.annotation:jsr250-api'
+ optional 'net.sf.ehcache:ehcache'
+ optional 'org.aspectj:aspectjrt'
+ optional 'org.springframework:spring-jdbc'
+ optional 'org.springframework:spring-tx'
+
+ testCompile powerMockDependencies
+ testCompile 'commons-collections:commons-collections'
+ testCompile 'org.skyscreamer:jsonassert'
+ testCompile 'org.slf4j:jcl-over-slf4j'
+ testCompile 'org.springframework:spring-test'
+
+ testRuntime 'org.hsqldb:hsqldb'
+}
+
+classes.doLast {
+ copy {
+ from includeProject.sourceSets.main.output
+ into sourceSets.main.output.classesDir
+ }
+}
+
+tasks.sourcesJar.from {includeProject.sourceSets.main.java}
+
+configure(project.tasks.withType(Test)) {
+ systemProperties['springSecurityVersion'] = version
+ systemProperties['springVersion'] = project.dependencyManagement.managedVersions['org.springframework:spring-core']
+}
+
+task testJar(type: Jar) {
+ classifier = 'tests'
+ from sourceSets.test.output
+}
+
+artifacts {
+ tests testJar
+}
+
+uploadPublished {
+ // maven deployer configuration
+}
+
+install {
+ configuration = configurations.published
+}
diff --git a/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java b/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java
index 0348315e50..fc32aeef43 100644
--- a/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java
+++ b/core/src/main/java/org/springframework/security/core/SpringSecurityCoreVersion.java
@@ -40,7 +40,7 @@ public class SpringSecurityCoreVersion {
*/
public static final long SERIAL_VERSION_UID = 500L;
- static final String MIN_SPRING_VERSION = "4.3.5.RELEASE";
+ static final String MIN_SPRING_VERSION = "5.0.0.BUILD-SNAPSHOT";
static {
performVersionChecks();
diff --git a/crypto/crypto.gradle b/crypto/crypto.gradle
deleted file mode 100644
index d226db0bdd..0000000000
--- a/crypto/crypto.gradle
+++ /dev/null
@@ -1,3 +0,0 @@
-dependencies {
- optional 'org.bouncycastle:bcpkix-jdk15on:1.54'
-}
\ No newline at end of file
diff --git a/crypto/spring-security-crypto.gradle b/crypto/spring-security-crypto.gradle
new file mode 100644
index 0000000000..b757f4f7ce
--- /dev/null
+++ b/crypto/spring-security-crypto.gradle
@@ -0,0 +1,6 @@
+apply plugin: 'io.spring.convention.spring-module'
+
+dependencies {
+ optional 'commons-logging:commons-logging'
+ optional 'org.bouncycastle:bcpkix-jdk15on'
+}
diff --git a/data/data.gradle b/data/data.gradle
deleted file mode 100644
index 9de1fe8d2d..0000000000
--- a/data/data.gradle
+++ /dev/null
@@ -1,6 +0,0 @@
-dependencies {
- compile project(':spring-security-core'),
- springCoreDependency,
- "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
-
-}
\ No newline at end of file
diff --git a/data/spring-security-data.gradle b/data/spring-security-data.gradle
new file mode 100644
index 0000000000..aa3a22116d
--- /dev/null
+++ b/data/spring-security-data.gradle
@@ -0,0 +1,7 @@
+apply plugin: 'io.spring.convention.spring-module'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile 'org.springframework.data:spring-data-commons'
+ compile 'org.springframework:spring-core'
+}
diff --git a/docs/docs.gradle b/docs/docs.gradle
deleted file mode 100644
index 52f896d200..0000000000
--- a/docs/docs.gradle
+++ /dev/null
@@ -1,159 +0,0 @@
- // Docbook and Javadoc building and uploading tasks
-apply plugin: 'base'
-
-task docs {
- dependsOn 'manual:reference', 'apidocs', 'guides:asciidoctor'
-}
-
-project('manual') {
- apply plugin: 'base'
- apply plugin: 'org.asciidoctor.gradle.asciidoctor'
- apply plugin: 'docbook-reference'
-
- ext.expandPlaceholders = ""
-
- asciidoctorj {
- version = '1.5.2'
- }
-
- asciidoctor {
- backends = ['docbook5']
- def ghTag = snapshotBuild ? 'master' : project.version
- def ghUrl = "https://github.com/spring-projects/spring-security/tree/$ghTag"
- options = [
- eruby: 'erubis',
- attributes: [
- copycss : '',
- icons : 'font',
- 'source-highlighter': 'prettify',
- sectanchors : '',
- toc2: '',
- idprefix: '',
- idseparator: '-',
- doctype: 'book',
- numbered: '',
- 'spring-security-version' : project.version,
- 'spring-version' : springVersion,
- revnumber : project.version,
- 'gh-url': ghUrl,
- 'gh-samples-url': "$ghUrl/samples",
- docinfo : ""
- ]
- ]
- }
-
- reference {
- sourceDir = new File(asciidoctor.outputDir , 'docbook5')
- pdfFilename = "spring-security-reference.pdf"
- epubFilename = "spring-security-reference.epub"
- expandPlaceholders = ""
- }
-
- afterEvaluate {
- tasks.findAll { it.name.startsWith("reference") }.each{ it.dependsOn.add("asciidoctor") }
- }
-
-
- ext.spec = copySpec {
- from (reference) {
- into 'reference'
- }
- }
-}
-
-task apidocs(type: Javadoc) {
- destinationDir = new File(buildDir, 'apidocs')
- title = "Spring Security $version API"
- logging.captureStandardError LogLevel.INFO
- logging.captureStandardOutput LogLevel.INFO
-
- source coreModuleProjects.collect { project ->
- project.sourceSets.main.allJava
- }
-
- classpath = files(coreModuleProjects.collect { project ->
- project.sourceSets.main.compileClasspath
- })
- options {
- outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
- links = [
- "http://static.springframework.org/spring/docs/3.2.x/javadoc-api",
- "http://static.springsource.org/spring-ldap/docs/1.3.x/apidocs/",
- "http://download.oracle.com/javase/6/docs/api/"
- ]
- groups = [
- 'Spring Security Core':[
- 'org.springframework.security.core*',
- 'org.springframework.security.authentication*',
- 'org.springframework.security.access*',
- 'org.springframework.security.remoting*',
- 'org.springframework.security.provisioning*',
- 'org.springframework.security.util*'],
- 'Spring Security Web':['org.springframework.security.web*'],
- 'Spring Security LDAP':['org.springframework.security.ldap*'],
- 'Spring Security Crypto':['org.springframework.security.crypto*'],
- 'Spring Security OpenID':['org.springframework.security.openid*'],
- 'Spring Security CAS':['org.springframework.security.cas*'],
- 'Spring Security ACL':['org.springframework.security.acls*'],
- 'Spring Security Config':['org.springframework.security.config*'],
- 'Spring Security Taglibs':['org.springframework.security.taglibs*'],
-
- ]
- addStringOption('-quiet')
- }
-}
-
-if (JavaVersion.current().isJava8Compatible()) {
- // Turn off doclint in JDK 8 Javadoc (too strict on checks)
- apidocs.options.addStringOption('Xdoclint:none', '-quiet')
-}
-
-ext.apiSpec = copySpec {
- into('apidocs') {
- from(apidocs.destinationDir)
- }
-}
-
-assemble.dependsOn = [apidocs, 'manual:asciidoctor']
-
-task docsZip(type: Zip) {
- dependsOn docs
- evaluationDependsOn('guides')
- group = 'Distribution'
- baseName = rootProject.name
- classifier = 'docs'
- description = "Builds -${classifier} archive containing api and reference " +
- "for deployment at static.springframework.org/spring-security/site/docs."
-
- with(project(':docs').apiSpec)
- with(project(':docs:manual').spec)
- with(project(':docs:guides').spec)
-}
-
-task schemaZip(type: Zip) {
- group = 'Distribution'
- baseName = rootProject.name
- classifier = 'schema'
- description = "Builds -${classifier} archive containing all " +
- "XSDs for deployment at static.springframework.org/schema."
-
- coreModuleProjects.each { module ->
- def Properties schemas = new Properties();
-
- module.sourceSets.main.resources.find {
- it.path.endsWith('META-INF/spring.schemas')
- }?.withInputStream { schemas.load(it) }
-
- for (def key : schemas.keySet()) {
- def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
- assert shortName != key
- File xsdFile = module.sourceSets.main.resources.find {
- it.path.endsWith(schemas.get(key))
- }
- assert xsdFile != null
- into (shortName) {
- from xsdFile.path
- }
- }
- }
-}
diff --git a/docs/guides/build.gradle b/docs/guides/spring-security-docs-guides.gradle
similarity index 100%
rename from docs/guides/build.gradle
rename to docs/guides/spring-security-docs-guides.gradle
diff --git a/docs/manual/spring-security-docs-manual.gradle b/docs/manual/spring-security-docs-manual.gradle
new file mode 100644
index 0000000000..39b6412c3f
--- /dev/null
+++ b/docs/manual/spring-security-docs-manual.gradle
@@ -0,0 +1,11 @@
+apply plugin: 'io.spring.convention.docs'
+
+asciidoctor {
+ def ghTag = snapshotBuild ? 'master' : project.version
+ def ghUrl = "https://github.com/spring-projects/spring-security/tree/$ghTag"
+ attributes 'spring-security-version' : project.version,
+ 'spring-version' : project(':spring-security-core').dependencyManagement.managedVersions['org.springframework:spring-core'],
+ revnumber : project.version,
+ 'gh-url': ghUrl,
+ 'gh-samples-url': "$ghUrl/samples"
+}
diff --git a/docs/spring-security-docs.gradle b/docs/spring-security-docs.gradle
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/gradle.properties b/gradle.properties
index 0114fb7771..e4104b3046 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1 +1,4 @@
+springBootVersion=1.5.2.RELEASE
version=5.0.0.BUILD-SNAPSHOT
+springIoVersion=Cairo-BUILD-SNAPSHOT
+gaeVersion=1.9.23
diff --git a/gradle/boot-sample.gradle b/gradle/boot-sample.gradle
deleted file mode 100644
index 20aab537d0..0000000000
--- a/gradle/boot-sample.gradle
+++ /dev/null
@@ -1,13 +0,0 @@
-apply plugin: 'org.springframework.boot'
-
-sonarqube {
- skipProject = true
-}
-
-configurations.all {
- resolutionStrategy.eachDependency { DependencyResolveDetails details ->
- if (details.requested.group == 'org.springframework') {
- details.useVersion springVersion
- }
- }
-}
\ No newline at end of file
diff --git a/gradle/checkstyle.gradle b/gradle/checkstyle.gradle
deleted file mode 100644
index 0fc34720f0..0000000000
--- a/gradle/checkstyle.gradle
+++ /dev/null
@@ -1,12 +0,0 @@
-apply plugin: 'checkstyle'
-
-checkstyle {
- configFile = rootProject.file('etc/checkstyle/checkstyle.xml')
- configProperties.configDir = configFile.parentFile
- toolVersion = '6.16.1'
-}
-task checkstyle {
- dependsOn project.tasks.findAll { task -> task.name.matches('checkstyle\\w+') }
-}
-
-check.dependsOn tasks.checkstyle
\ No newline at end of file
diff --git a/gradle/dependency-management.properties b/gradle/dependency-management.properties
new file mode 100644
index 0000000000..4570c74e95
--- /dev/null
+++ b/gradle/dependency-management.properties
@@ -0,0 +1,12 @@
+cglib\:cglib-nodep=3.2.5
+opensymphony\:sitemesh=2.4.2
+org.gebish\:geb-spock=0.10.0
+org.jasig.cas\:cas-server-webapp=4.0.0
+org.mockito\:mockito-core=1.10.19
+org.powermock\:powermock-api-mockito=1.6.2
+org.powermock\:powermock-api-support=1.6.2
+org.powermock\:powermock-core=1.6.2
+org.powermock\:powermock-module-junit4-common=1.6.2
+org.powermock\:powermock-module-junit4=1.6.2
+org.powermock\:powermock-reflect=1.6.2
+org.python\:jython=2.5.0
diff --git a/gradle/ide.gradle b/gradle/ide.gradle
deleted file mode 100644
index f502691072..0000000000
--- a/gradle/ide.gradle
+++ /dev/null
@@ -1,98 +0,0 @@
-import org.gradle.plugins.ide.eclipse.model.SourceFolder
-
-apply plugin: 'eclipse-wtp'
-apply plugin: 'propdeps-idea'
-apply plugin: 'propdeps-eclipse'
-
-eclipse.classpath.downloadSources = true
-
-
-eclipse.project.buildCommand "net.sf.eclipsecs.core.CheckstyleBuilder"
-eclipse.project.natures "net.sf.eclipsecs.core.CheckstyleNature"
-
-// Include project specific settings
-task eclipseCheckstyle(type: Copy) {
- from rootProject.files(
- "etc/eclipse/.checkstyle")
- into project.projectDir
- expand(configDir: rootProject.file('etc/checkstyle').absolutePath)
-}
-task eclipseSettings(type: Copy) {
- from rootProject.files(
- "etc/eclipse/org.eclipse.jdt.ui.prefs",
- "etc/eclipse/org.eclipse.wst.common.project.facet.core.xml")
- into project.file('.settings/')
- outputs.upToDateWhen { false }
-}
-
-task eclipseWstComponent(type: Copy) {
- from rootProject.files(
- "etc/eclipse/org.eclipse.wst.common.component")
- into project.file('.settings/')
- expand(deployname: project.name)
- outputs.upToDateWhen { false }
-}
-
-task eclipseJdtPrepare(type: Copy) {
- from rootProject.file("etc/eclipse/org.eclipse.jdt.core.prefs")
- into project.file(".settings/")
- outputs.upToDateWhen { false }
-}
-
-task cleanEclipseJdtUi(type: Delete) {
- delete project.file(".settings/org.eclipse.jdt.core.prefs")
- delete project.file(".settings/org.eclipse.jdt.ui.prefs")
- delete project.file(".settings/org.eclipse.wst.common.component")
- delete project.file(".settings/org.eclipse.wst.common.project.facet.core.xml")
-}
-
-tasks["eclipseJdt"].dependsOn(eclipseJdtPrepare)
-tasks["cleanEclipse"].dependsOn(cleanEclipseJdtUi)
-tasks["eclipse"].dependsOn(eclipseCheckstyle, eclipseSettings, eclipseWstComponent)
-
-task eclipseConfiguration(dependsOn: [eclipseCheckstyle, eclipseSettings, eclipseWstComponent]) {
-}
-
-eclipse {
- classpath {
- plusConfigurations += [ configurations.integrationTestCompile ]
- }
-}
-
-// http://forums.gradle.org/gradle/topics/eclipse_wtp_deploys_testcode_to_server_example_provided
-eclipse.classpath {
- defaultOutputDir = file('bin/main')
- file.whenMerged { cp ->
- cp.entries.findAll { it instanceof SourceFolder && (it.path.contains("test") || it.path.contains("Test")) }*.output = "bin/test"
- }
-}
-
-// GRADLE-1116
-project.eclipse.classpath.file.whenMerged { classpath ->
- classpath.entries.removeAll { entry -> entry.path.endsWith('/build/resources/test') }
- classpath.entries.removeAll { entry -> entry.path.endsWith('/build/classes/test') }
- classpath.entries.removeAll { entry -> entry.path.endsWith('/build/resources/main') }
- classpath.entries.removeAll { entry -> entry.path.endsWith('/build/classes/main') }
-}
-
-// GRADLE-1422
-project.eclipseClasspath.doFirst {
- // delay adding whenMerged till the entryAttributes are added (must be the last whenMerged)
- project.eclipse.classpath.file.whenMerged { classpath ->
- def includeDeps = project.configurations.getByName('runtime').collect {f -> f.absolutePath } as Set
- classpath.entries.each { cp ->
- if(cp instanceof org.gradle.plugins.ide.eclipse.model.Library) {
- def include = includeDeps.contains(cp.path)
- def attr = 'org.eclipse.jst.component.dependency'
- if(!include) {
- cp.entryAttributes.remove(attr)
- }
- }
- }
- }
-}
-
-project.idea.module {
- scopes.TEST.plus += [project.configurations.integrationTestRuntime]
- testSourceDirs += sourceSets.integrationTest.resources.srcDirs
-}
\ No newline at end of file
diff --git a/gradle/javaprojects.gradle b/gradle/javaprojects.gradle
deleted file mode 100644
index 8c9db93a27..0000000000
--- a/gradle/javaprojects.gradle
+++ /dev/null
@@ -1,244 +0,0 @@
-
-apply plugin: 'java'
-apply plugin: 'groovy'
-apply plugin: 'javadocHotfix'
-apply plugin: 'propdeps'
-apply plugin: 'propdeps-maven'
-
-sourceCompatibility = 1.8
-targetCompatibility = 1.8
-
-ext.apacheDsVersion = '1.5.5'
-ext.aspectjVersion = '1.8.4'
-ext.casClientVersion = '3.4.1'
-ext.cglibVersion = '3.2.5'
-ext.commonsCodecVersion = '1.10'
-ext.commonsCollectionsVersion = '3.2.2'
-ext.commonsLoggingVersion = '1.2'
-ext.ehcacheVersion = '2.9.0'
-ext.gebVersion = '0.10.0'
-ext.groovyVersion = '2.4.4'
-ext.hsqlVersion = '2.3.2'
-ext.hibernateVersion = '5.0.11.Final'
-ext.hibernateValidatorVersion = '5.2.4.Final'
-ext.jacksonDatabindVersion = '2.8.4'
-ext.javaPersistenceVersion = '2.1.1'
-ext.jettyVersion = '6.1.26'
-ext.jstlVersion = '1.2.1'
-ext.junitVersion = '4.12'
-ext.logbackVersion = '1.1.2'
-ext.powerMockVersion = '1.6.5'
-ext.seleniumVersion = '2.44.0'
-ext.servletApiVersion = '3.1.0'
-ext.slf4jVersion = '1.7.7'
-ext.spockVersion = '0.7-groovy-2.0'
-ext.springDataCommonsVersion = '1.12.2.RELEASE'
-ext.springDataJpaVersion = '1.10.2.RELEASE'
-ext.springDataRedisVersion = '1.7.2.RELEASE'
-ext.springSessionVersion = '1.2.1.RELEASE'
-ext.springBootVersion = '1.5.0.BUILD-SNAPSHOT'
-ext.thymeleafVersion = '3.0.2.RELEASE'
-ext.jsonassertVersion = '1.3.0'
-ext.validationApiVersion = '1.1.0.Final'
-
-
-ext.spockDependencies = [
- dependencies.create("org.spockframework:spock-spring:$spockVersion") {
- exclude group: 'junit', module: 'junit-dep'
- },
- dependencies.create("org.spockframework:spock-core:$spockVersion") {
- exclude group: 'junit', module: 'junit-dep'
- }
-]
-
-ext.gebDependencies = spockDependencies + [
- "org.seleniumhq.selenium:selenium-htmlunit-driver:$seleniumVersion",
- "org.gebish:geb-spock:$gebVersion",
- 'commons-httpclient:commons-httpclient:3.1',
- "org.codehaus.groovy:groovy:$groovyVersion",
- "org.codehaus.groovy:groovy-all:$groovyVersion"
-]
-
-ext.powerMockDependencies = [
- "org.powermock:powermock-core:$powerMockVersion",
- "org.powermock:powermock-api-support:$powerMockVersion",
- "org.powermock:powermock-module-junit4-common:$powerMockVersion",
- "org.powermock:powermock-module-junit4:$powerMockVersion",
- dependencies.create("org.powermock:powermock-api-mockito:$powerMockVersion") {
- exclude group: 'org.mockito', module: 'mockito-all'
- },
- "org.powermock:powermock-reflect:$powerMockVersion"
-]
-
-ext.springCoreDependency = [
- dependencies.create("org.springframework:spring-core:$springVersion") {
- exclude(group: 'commons-logging', module: 'commons-logging')
- }
-]
-
-ext.jstlDependencies = [
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "org.apache.taglibs:taglibs-standard-jstlel:1.2.1"
-]
-
-ext.apachedsDependencies = [
- "org.apache.directory.server:apacheds-core:$apacheDsVersion",
- "org.apache.directory.server:apacheds-core-entry:$apacheDsVersion",
- "org.apache.directory.server:apacheds-protocol-shared:$apacheDsVersion",
- "org.apache.directory.server:apacheds-protocol-ldap:$apacheDsVersion",
- "org.apache.directory.server:apacheds-server-jndi:$apacheDsVersion",
- 'org.apache.directory.shared:shared-ldap:0.9.15'
-]
-
-// Integration test setup
-configurations {
- integrationTestCompile {
- extendsFrom testCompile, optional, provided
- }
- integrationTestRuntime {
- extendsFrom integrationTestCompile, testRuntime
- }
- springSnapshotTestRuntime.extendsFrom testRuntime
-}
-
-configurations.springSnapshotTestRuntime {
- resolutionStrategy.eachDependency { DependencyResolveDetails details ->
- if (details.requested.group == 'org.springframework') {
- details.useVersion 'latest.integration'
- }
- }
-}
-
-sourceSets {
- integrationTest {
- java.srcDir file('src/integration-test/java')
- groovy.srcDirs file('src/integration-test/groovy')
- resources.srcDir file('src/integration-test/resources')
- compileClasspath = sourceSets.main.output + sourceSets.test.output + configurations.integrationTestCompile
- runtimeClasspath = output + compileClasspath + configurations.integrationTestRuntime
- }
-}
-
-task integrationTest(type: Test, dependsOn: jar) {
- testClassesDir = sourceSets.integrationTest.output.classesDir
- logging.captureStandardOutput(LogLevel.INFO)
- classpath = sourceSets.integrationTest.runtimeClasspath
- maxParallelForks = 1
- reports {
- html.destination = project.file("$project.buildDir/reports/integration-tests/")
- junitXml.destination = project.file("$project.buildDir/integration-test-results/")
- }
-}
-
-project.conf2ScopeMappings.addMapping(MavenPlugin.TEST_COMPILE_PRIORITY + 1, project.configurations.getByName("integrationTestCompile"), Conf2ScopeMappingContainer.TEST)
-project.conf2ScopeMappings.addMapping(MavenPlugin.TEST_COMPILE_PRIORITY + 2, project.configurations.getByName("integrationTestRuntime"), Conf2ScopeMappingContainer.TEST)
-check.dependsOn integrationTest
-
-task springSnapshotTest(type: Test) {
- jvmArgs = ['-ea', '-Xmx500m', '-XX:MaxPermSize=128M']
- classpath = sourceSets.test.output + sourceSets.main.output + configurations.springSnapshotTestRuntime
- reports {
- html.destination = project.file("$buildDir/spring-snapshot-test-results/")
- junitXml.destination = project.file("$buildDir/reports/spring-snapshot-tests/")
- }
-}
-
-dependencies {
- optional "commons-logging:commons-logging:$commonsLoggingVersion"
-
- testCompile "junit:junit:$junitVersion",
- 'org.mockito:mockito-core:1.10.19',
- "org.springframework:spring-test:$springVersion",
- 'org.assertj:assertj-core:3.6.2'
-
- // Use slf4j/logback for logging
- testRuntime "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "ch.qos.logback:logback-classic:$logbackVersion"
-}
-
-[configurations.runtime, configurations.default, configurations.testCompile]*.exclude(module: 'commons-logging')
-
-configurations.all {
- resolutionStrategy.eachDependency { DependencyResolveDetails details ->
- if (details.requested.group == 'org.slf4j') {
- details.useVersion slf4jVersion
- }
- }
-}
-
-[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
-
-project.tasks.matching { it instanceof Test && it.name != 'integrationTest' }.all {
- jvmArgs = ['-ea', '-Xmx500m', '-XX:MaxPermSize=512m']
- maxParallelForks = guessMaxForks()
- logging.captureStandardOutput(LogLevel.INFO)
-}
-
-def guessMaxForks() {
- int processors = Runtime.runtime.availableProcessors()
- return Math.max(2, (int) (processors / 2))
-}
-
-jar {
- manifest.attributes["Created-By"] = 'Spring Security Team'
- manifest.attributes["Implementation-Title"] = project.name
- manifest.attributes["Implementation-Version"] = project.version
- manifest.attributes["Premain-Class"] =
- manifest.attributes["Agent-Class"] =
- manifest.attributes["Can-Redefine-Classes"] = "true"
- manifest.attributes["Can-Retransform-Classes"] = "true"
- manifest.attributes["Can-Set-Native-Method-Prefix"] = "false"
-}
-
-javadoc {
- title = "Spring Security $version API"
- source = sourceSets.main.allJava
- logging.captureStandardError LogLevel.INFO
- logging.captureStandardOutput LogLevel.INFO
- options {
- memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
- author = true
- header = project.name
- outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
- links = [
- "http://static.springsource.org/spring/docs/3.2.x/javadoc-api/",
- "http://static.springsource.org/spring-ldap/docs/1.3.x/apidocs/",
- "http://download.oracle.com/javase/6/docs/api/"
- ]
- groups = [
- 'Spring Security Core':[
- 'org.springframework.security.core*',
- 'org.springframework.security.authentication*',
- 'org.springframework.security.access*',
- 'org.springframework.security.remoting*',
- 'org.springframework.security.provisioning*',
- 'org.springframework.security.util*'],
- 'Spring Security Web':['org.springframework.security.web*'],
- 'Spring Security LDAP':['org.springframework.security.ldap*'],
- 'Spring Security Crypto':['org.springframework.security.crypto*'],
- 'Spring Security OpenID':['org.springframework.security.openid*'],
- 'Spring Security CAS':['org.springframework.security.cas*'],
- 'Spring Security ACL':['org.springframework.security.acls*'],
- 'Spring Security Config':['org.springframework.security.config*'],
- 'Spring Security Taglibs':['org.springframework.security.taglibs*'],
- 'Spring Security Test':['org.springframework.security.test*'],
- ]
- addStringOption('-quiet')
- }
-}
-
-if (JavaVersion.current().isJava8Compatible()) {
- tasks.withType(Javadoc) {
- // Turn off doclint in JDK 8 Javadoc (too strict on checks)
- options.addStringOption('Xdoclint:none', '-quiet')
- }
-}
-
-task javadocJar(type: Jar) {
- classifier = 'javadoc'
- from javadoc
-}
-
-artifacts {
- archives javadocJar
-}
diff --git a/gradle/maven-deployment.gradle b/gradle/maven-deployment.gradle
deleted file mode 100644
index 1d0e9cde8a..0000000000
--- a/gradle/maven-deployment.gradle
+++ /dev/null
@@ -1,152 +0,0 @@
-apply plugin: 'maven'
-
-// Create a source jar for uploading
-task sourceJar(type: Jar) {
- classifier = 'sources'
- from sourceSets.main.java.srcDirs
- include '**/*.java', '**/*.aj'
-}
-
-artifacts {
- archives sourceJar
-}
-
-// Configuration for SpringSource s3 maven deployer
-configurations {
- deployerJars
-}
-dependencies {
- deployerJars "org.springframework.build.aws:org.springframework.build.aws.maven:3.0.0.RELEASE"
-}
-
-install {
- repositories.mavenInstaller {
- customizePom(pom, project)
- }
-}
-
-def customizePom(pom, gradleProject) {
- pom.whenConfigured { p ->
- p.dependencies.findAll{ it.scope == "optional" }.each {
- it.scope = "compile"
- it.optional = true
- }
- p.dependencies.findAll{ it.groupId == "org.springframework" }.each {
- it.version = null
- }
- // sort to make pom dependencies order consistent to ease comparison of older poms
- p.dependencies = p.dependencies.sort { dep ->
- "$dep.scope:$dep.optional:$dep.groupId:$dep.artifactId"
- }
- }
- def isWar = project.hasProperty('war')
- pom.project {
- name = gradleProject.name
- if(isWar) {
- packaging = "war"
- }
- description = gradleProject.name
- url = 'http://spring.io/spring-security'
- organization {
- name = 'spring.io'
- url = 'http://spring.io/'
- }
- licenses {
- license {
- name 'The Apache Software License, Version 2.0'
- url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
- distribution 'repo'
- }
- }
- scm {
- url = 'https://github.com/spring-projects/spring-security'
- connection = 'scm:git:git://github.com/spring-projects/spring-security'
- developerConnection = 'scm:git:git://github.com/spring-projects/spring-security'
- }
- developers {
- developer {
- id = 'rwinch'
- name = 'Rob Winch'
- email = 'rwinch@pivotal.io'
- }
- developer {
- id = 'jgrandja'
- name = 'Joe Grandja'
- email = 'jgrandja@pivotal.io'
- }
- }
-
- if(!gradleProject.name.endsWith('-bom')) {
- dependencyManagement {
- dependencies {
- dependency {
- groupId 'org.springframework'
- artifactId 'spring-framework-bom'
- version project.springVersion
- type 'pom'
- scope 'import'
- }
- }
- }
- }
- if(isWar) {
- properties {
- 'm2eclipse.wtp.contextRoot' '/' + project.war.baseName
- }
- }
- if(project.snapshotBuild) {
- repositories {
- repository {
- id 'spring-snapshot'
- url 'https://repo.spring.io/snapshot'
- }
- }
- } else if(!project.releaseBuild) {
- repositories {
- repository {
- id 'spring-milestone'
- url 'https://repo.spring.io/milestone'
- }
- }
- }
- }
-
- // http://forums.gradle.org/gradle/topics/after_upgrade_gradle_to_2_0_version_the_maven_pom_not_support_build_property
- pom.withXml {
- def plugins = asNode().appendNode('build').appendNode('plugins')
- plugins
- .appendNode('plugin')
- .appendNode('artifactId','maven-compiler-plugin').parent()
- .appendNode('configuration')
- .appendNode('source','1.8').parent()
- .appendNode('target','1.8')
- if(isWar) {
- plugins
- .appendNode('plugin')
- .appendNode('artifactId','maven-war-plugin').parent()
- .appendNode('version','2.3').parent()
- .appendNode('configuration')
- .appendNode('failOnMissingWebXml','false')
- }
- }
-}
-
-task generatePom {
- group = 'Build'
- description = 'Generates a Maven pom.xml'
-
- ext.generatedPomFileName = "pom.xml"
- onlyIf { install.enabled }
-
- inputs.files(fileTree(project.rootProject.rootDir).include("**/*.gradle").files)
- inputs.files(new File(project.rootProject.rootDir, Project.GRADLE_PROPERTIES))
- outputs.files(generatedPomFileName)
-
- doLast() {
- def p = pom {}
- customizePom(p, project)
- p.writeTo(generatedPomFileName)
- }
-}
-
-build.dependsOn generatePom
diff --git a/gradle/release-checks.gradle b/gradle/release-checks.gradle
deleted file mode 100644
index 4cf510694e..0000000000
--- a/gradle/release-checks.gradle
+++ /dev/null
@@ -1,22 +0,0 @@
-task checkDependencies << {
- verifyNoDependenciesMatchingVersion(".*-SNAPSHOT")
- if(releaseBuild) {
- verifyNoDependenciesMatchingVersion(".*M.*")
- verifyNoDependenciesMatchingVersion(".*RC.*")
- }
-}
-
-if(!snapshotBuild) {
- tasks.findByPath('check')?.dependsOn checkDependencies
-}
-
-def verifyNoDependenciesMatchingVersion(def pattern) {
- def dependencies = configurations.all*.allDependencies*.findAll { d ->
- def ignored = 'io.spring.platform:platform-versions'
- def groupAndName = "$d.group:$d.name".toString()
- ignored != groupAndName && d.version?.matches(pattern)
- }.flatten().toSet().join("\n ")
- if(dependencies) {
- throw new GradleException("${project.name} cannot have dependencies with a version that matches $pattern when its version is ${project.version}. Got\n $dependencies")
- }
-}
\ No newline at end of file
diff --git a/gradle/springio-dependency-management.properties b/gradle/springio-dependency-management.properties
new file mode 100644
index 0000000000..1fae01c03b
--- /dev/null
+++ b/gradle/springio-dependency-management.properties
@@ -0,0 +1 @@
+org.mockito\:mockito-core=1.10.19
diff --git a/gradle/tomcat.gradle b/gradle/tomcat.gradle
deleted file mode 100644
index 767eb9083b..0000000000
--- a/gradle/tomcat.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-buildscript {
- repositories {
- maven { url "https://repo.spring.io/plugins-release" }
- }
- dependencies {
- classpath("com.bmuschko:gradle-tomcat-plugin:2.2.4")
- }
-}
-
-apply plugin: 'com.bmuschko.tomcat'
-
-dependencies {
- def tomcatVersion = '7.0.54'
- tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
- "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}",
- "org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}",
- "org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}"
-}
-
-task integrationTomcatRun(type: com.bmuschko.gradle.tomcat.tasks.TomcatRun) {
- onlyIf { !sourceSets.integrationTest.allSource.empty }
- daemon = true
- tomcatClasspath = tomcatRun.tomcatClasspath
- webAppClasspath = tomcatRun.webAppClasspath
- webAppSourceDirectory = tomcatRun.webAppSourceDirectory
- doFirst {
- def mainOutputDir = project.sourceSets.main.output.classesDir
- if(mainOutputDir) {
- classesDirectory = mainOutputDir
- }
- contextPath = tomcatRun.contextPath
- // delay reserving ports to ensure they are still available
- def ports = reservePorts(3)
- httpPort = ports[0]
- ajpPort = ports[1]
- stopPort = ports[2]
- }
-}
-
-task integrationTomcatStop(type: com.bmuschko.gradle.tomcat.tasks.TomcatStop) {
- onlyIf { !sourceSets.integrationTest.allSource.empty }
- doFirst {
- stopPort = integrationTomcatRun.stopPort
- }
-}
-
-integrationTest {
- dependsOn integrationTomcatRun
- doFirst {
- def host = 'localhost:' + integrationTomcatRun.httpPort
- systemProperties['geb.build.baseUrl'] = 'http://'+host+'/' + integrationTomcatRun.contextPath + '/'
- systemProperties['geb.build.reportsDir'] = 'build/geb-reports'
- }
- finalizedBy integrationTomcatStop
-}
-
-def reservePorts(int count) {
- def sockets = []
- for(int i in 1..count) {
- sockets << new ServerSocket(0)
- }
- def result = sockets*.localPort
- sockets*.close()
- result
-}
\ No newline at end of file
diff --git a/gradle/war-sample.gradle b/gradle/war-sample.gradle
deleted file mode 100644
index 5250d0bd3b..0000000000
--- a/gradle/war-sample.gradle
+++ /dev/null
@@ -1,10 +0,0 @@
-apply plugin: 'war'
-apply from: TOMCAT_GRADLE
-
-war {
- baseName = "sample"
-}
-
-sonarqube {
- skipProject = true
-}
\ No newline at end of file
diff --git a/itest/context/itest-context.gradle b/itest/context/itest-context.gradle
deleted file mode 100644
index b6986dc182..0000000000
--- a/itest/context/itest-context.gradle
+++ /dev/null
@@ -1,17 +0,0 @@
-System.setProperty('python.cachedir.skip', 'true')
-
-dependencies {
- compile project(':spring-security-core'),
- 'aopalliance:aopalliance:1.0',
- 'org.python:jython:2.5.0',
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-aop:$springVersion",
- "org.springframework:spring-tx:$springVersion",
- "org.springframework:spring-beans:$springVersion"
-
- testCompile project(':spring-security-web'),
- "javax.servlet:javax.servlet-api:$servletApiVersion",
- "org.springframework:spring-web:$springVersion"
- testRuntime project(':spring-security-config'),
- "org.aspectj:aspectjweaver:$aspectjVersion"
-}
\ No newline at end of file
diff --git a/itest/context/spring-security-itest-context.gradle b/itest/context/spring-security-itest-context.gradle
new file mode 100644
index 0000000000..3f54200b0a
--- /dev/null
+++ b/itest/context/spring-security-itest-context.gradle
@@ -0,0 +1,20 @@
+apply plugin: 'io.spring.convention.spring-test'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile 'aopalliance:aopalliance'
+ compile 'org.python:jython'
+ compile 'org.springframework:spring-aop'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-tx'
+
+ testCompile project(':spring-security-web')
+ testCompile 'javax.servlet:javax.servlet-api'
+ testCompile 'org.springframework:spring-web'
+
+ testRuntime project(':spring-security-config')
+ testRuntime 'org.aspectj:aspectjweaver'
+}
+
+System.setProperty('python.cachedir.skip', 'true')
diff --git a/itest/web/itest-web.gradle b/itest/web/itest-web.gradle
deleted file mode 100644
index d9e19962b6..0000000000
--- a/itest/web/itest-web.gradle
+++ /dev/null
@@ -1,24 +0,0 @@
-
-dependencies {
- compile "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-web:$springVersion"
-
- provided "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- testCompile project(':spring-security-core'),
- project(':spring-security-web'),
- project(':spring-security-test'),
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-test:$springVersion"
-
- testRuntime project(':spring-security-config'),
- project(':spring-security-ldap')
-}
-
-integrationTest {
- options {
- jvmArgs = ["-ea", '-Xms128m', '-Xmx500m']
- }
- maxParallelForks = 1
-}
diff --git a/itest/web/spring-security-itest-web.gradle b/itest/web/spring-security-itest-web.gradle
new file mode 100644
index 0000000000..bbe818a3db
--- /dev/null
+++ b/itest/web/spring-security-itest-web.gradle
@@ -0,0 +1,25 @@
+apply plugin: 'io.spring.convention.spring-test'
+
+dependencies {
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-web'
+
+ provided 'javax.servlet:javax.servlet-api'
+
+ testCompile project(':spring-security-core')
+ testCompile project(':spring-security-test')
+ testCompile project(':spring-security-web')
+ testCompile 'org.springframework:spring-beans'
+ testCompile 'org.springframework:spring-test'
+ testCompile 'org.springframework:spring-webmvc'
+
+ testRuntime project(':spring-security-config')
+ testRuntime project(':spring-security-ldap')
+}
+
+integrationTest {
+ options {
+ jvmArgs = ['-ea', '-Xms128m', '-Xmx500m']
+ }
+ maxParallelForks = 1
+}
diff --git a/ldap/ldap.gradle b/ldap/ldap.gradle
deleted file mode 100644
index 4555b36c37..0000000000
--- a/ldap/ldap.gradle
+++ /dev/null
@@ -1,41 +0,0 @@
-// Ldap build file
-
-dependencies {
- compile project(':spring-security-core'),
- springCoreDependency,
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-tx:$springVersion"
-
- optional "org.apache.directory.server:apacheds-core:$apacheDsVersion",
- "org.apache.directory.server:apacheds-core-entry:$apacheDsVersion",
- "org.apache.directory.server:apacheds-protocol-shared:$apacheDsVersion",
- "org.apache.directory.server:apacheds-protocol-ldap:$apacheDsVersion",
- "org.apache.directory.server:apacheds-server-jndi:$apacheDsVersion",
- 'org.apache.directory.shared:shared-ldap:0.9.15',
- 'ldapsdk:ldapsdk:4.1'
-
- compile ("org.springframework.ldap:spring-ldap-core:$springLdapVersion") {
- exclude(group: 'commons-logging', module: 'commons-logging')
- exclude(group: 'org.springframework', module: 'spring-core')
- exclude(group: 'org.springframework', module: 'spring-tx')
- exclude(group: 'org.springframework', module: 'spring-beans')
- exclude(group: 'org.springframework.data', module: 'spring-data-commons')
- }
-
- testCompile "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion"
-}
-
-integrationTest {
- include('**/ApacheDSServerIntegrationTests.class', '**/ApacheDSEmbeddedLdifTests.class')
-// exclude('**/OpenLDAPIntegrationTestSuite.class')
- maxParallelForks = 1
-}
-
-// Runs a server for running the integration tests against (from an IDE, for example)
-task(ldapServer, dependsOn: 'integrationTestClasses', type: JavaExec) {
- classpath = sourceSets.integrationTest.runtimeClasspath
- main = 'org.springframework.security.ldap.ApacheDSServerIntegrationTests'
-}
-
diff --git a/ldap/spring-security-ldap.gradle b/ldap/spring-security-ldap.gradle
new file mode 100644
index 0000000000..1602f3271e
--- /dev/null
+++ b/ldap/spring-security-ldap.gradle
@@ -0,0 +1,37 @@
+apply plugin: 'io.spring.convention.spring-module'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-core'
+ compile 'org.springframework:spring-tx'
+
+ optional apachedsDependencies
+ optional 'ldapsdk:ldapsdk'
+ optional 'org.apache.directory.shared:shared-ldap'
+
+ compile ('org.springframework.ldap:spring-ldap-core') {
+ exclude(group: 'commons-logging', module: 'commons-logging')
+ exclude(group: 'org.springframework', module: 'spring-beans')
+ exclude(group: 'org.springframework', module: 'spring-core')
+ exclude(group: 'org.springframework', module: 'spring-tx')
+ exclude(group: 'org.springframework.data', module: 'spring-data-commons')
+ }
+
+ testCompile 'org.slf4j:jcl-over-slf4j'
+ testCompile 'org.slf4j:slf4j-api'
+}
+
+integrationTest {
+ include('**/ApacheDSServerIntegrationTests.class', '**/ApacheDSEmbeddedLdifTests.class')
+// exclude('**/OpenLDAPIntegrationTestSuite.class')
+ maxParallelForks = 1
+}
+
+// Runs a server for running the integration tests against (from an IDE, for example)
+task(ldapServer, dependsOn: 'integrationTestClasses', type: JavaExec) {
+ classpath = sourceSets.integrationTest.runtimeClasspath
+ main = 'org.springframework.security.ldap.ApacheDSServerIntegrationTests'
+}
+
diff --git a/messaging/messaging.gradle b/messaging/messaging.gradle
deleted file mode 100644
index beb3eab4b0..0000000000
--- a/messaging/messaging.gradle
+++ /dev/null
@@ -1,24 +0,0 @@
-apply plugin: 'groovy'
-
-dependencies {
- compile project(':spring-security-core'),
- springCoreDependency,
- 'aopalliance:aopalliance:1.0',
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-expression:$springVersion",
- "org.springframework:spring-messaging:$springVersion"
-
- optional project(':spring-security-web'),
- "org.springframework:spring-websocket:$springVersion",
- "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- testCompile project(':spring-security-core').sourceSets.test.output,
- "commons-codec:commons-codec:$commonsCodecVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "org.codehaus.groovy:groovy-all:$groovyVersion",
- powerMockDependencies,
- spockDependencies
-
- testRuntime "org.hsqldb:hsqldb:$hsqlVersion"
-}
\ No newline at end of file
diff --git a/messaging/spring-security-messaging.gradle b/messaging/spring-security-messaging.gradle
new file mode 100644
index 0000000000..5ee9e2617b
--- /dev/null
+++ b/messaging/spring-security-messaging.gradle
@@ -0,0 +1,23 @@
+apply plugin: 'io.spring.convention.spring-module'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile 'aopalliance:aopalliance'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-core'
+ compile 'org.springframework:spring-expression'
+ compile 'org.springframework:spring-messaging'
+
+ optional project(':spring-security-web')
+ optional 'org.springframework:spring-websocket'
+ optional 'javax.servlet:javax.servlet-api'
+
+ testCompile project(path: ':spring-security-core', configuration: 'tests')
+ testCompile 'commons-codec:commons-codec'
+ testCompile powerMockDependencies
+ testCompile slf4jDependencies
+ testCompile spockDependencies
+
+ testRuntime 'org.hsqldb:hsqldb'
+}
diff --git a/openid/openid.gradle b/openid/openid.gradle
deleted file mode 100644
index e383326d24..0000000000
--- a/openid/openid.gradle
+++ /dev/null
@@ -1,24 +0,0 @@
-// OpenID Module build file
-
-dependencies {
- compile project(':spring-security-core'),
- project(':spring-security-web'),
- springCoreDependency,
- "org.springframework:spring-aop:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-web:$springVersion"
-
- // openid4java has a compile time dep on guice with a group
- // name which is different from the maven central one.
- // We use the maven central version here instead.
- compile('org.openid4java:openid4java-nodeps:0.9.6') {
- exclude group: 'com.google.code.guice', module: 'guice'
- }
- compile 'com.google.inject:guice:2.0'
-
- provided "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- runtime 'org.apache.httpcomponents:httpclient:4.2.3',
- 'net.sourceforge.nekohtml:nekohtml:1.9.20'
-}
diff --git a/openid/spring-security-openid.gradle b/openid/spring-security-openid.gradle
new file mode 100644
index 0000000000..dfa8de31cd
--- /dev/null
+++ b/openid/spring-security-openid.gradle
@@ -0,0 +1,23 @@
+apply plugin: 'io.spring.convention.spring-module'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile project(':spring-security-web')
+ compile 'com.google.inject:guice'
+ // openid4java has a compile time dep on guice with a group
+ // name which is different from the maven central one.
+ // We use the maven central version here instead.
+ compile('org.openid4java:openid4java-nodeps') {
+ exclude group: 'com.google.code.guice', module: 'guice'
+ }
+ compile 'org.springframework:spring-aop'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-core'
+ compile 'org.springframework:spring-web'
+
+ provided 'javax.servlet:javax.servlet-api'
+
+ runtime 'net.sourceforge.nekohtml:nekohtml'
+ runtime 'org.apache.httpcomponents:httpclient'
+}
diff --git a/remoting/remoting.gradle b/remoting/remoting.gradle
deleted file mode 100644
index 30f9b134b8..0000000000
--- a/remoting/remoting.gradle
+++ /dev/null
@@ -1,12 +0,0 @@
-// Remoting module build file
-
-dependencies {
- compile project(':spring-security-core'),
- 'aopalliance:aopalliance:1.0',
- springCoreDependency,
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-web:$springVersion"
-
- testCompile project(':spring-security-core').sourceSets.test.output
-}
diff --git a/remoting/spring-security-remoting.gradle b/remoting/spring-security-remoting.gradle
new file mode 100644
index 0000000000..ff6e06b787
--- /dev/null
+++ b/remoting/spring-security-remoting.gradle
@@ -0,0 +1,12 @@
+apply plugin: 'io.spring.convention.spring-module'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile 'aopalliance:aopalliance'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-core'
+ compile 'org.springframework:spring-web'
+
+ testCompile project(path: ':spring-security-core', configuration: 'tests')
+}
diff --git a/samples/boot/helloworld/build.gradle b/samples/boot/helloworld/build.gradle
deleted file mode 100644
index 455931c112..0000000000
--- a/samples/boot/helloworld/build.gradle
+++ /dev/null
@@ -1,16 +0,0 @@
-apply from: BOOT_SAMPLE_GRADLE
-
-springBoot {
- mainClass = 'org.springframework.security.samples.HelloWorldApplication'
-}
-
-dependencies {
- compile "org.springframework.boot:spring-boot-starter-web",
- "org.springframework.boot:spring-boot-starter-thymeleaf",
- "org.thymeleaf.extras:thymeleaf-extras-springsecurity4:2.1.2.RELEASE",
- project(":spring-security-config"),
- project(":spring-security-web")
-
- testCompile "org.springframework.boot:spring-boot-starter-test",
- project(":spring-security-test")
-}
\ No newline at end of file
diff --git a/samples/boot/helloworld/spring-security-samples-boot-helloworld.gradle b/samples/boot/helloworld/spring-security-samples-boot-helloworld.gradle
new file mode 100644
index 0000000000..133289d63a
--- /dev/null
+++ b/samples/boot/helloworld/spring-security-samples-boot-helloworld.gradle
@@ -0,0 +1,12 @@
+apply plugin: 'io.spring.convention.spring-sample-boot'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-web')
+ compile 'org.springframework.boot:spring-boot-starter-thymeleaf'
+ compile 'org.springframework.boot:spring-boot-starter-web'
+ compile 'org.thymeleaf.extras:thymeleaf-extras-springsecurity4'
+
+ testCompile project(':spring-security-test')
+ testCompile 'org.springframework.boot:spring-boot-starter-test'
+}
diff --git a/samples/boot/insecure/build.gradle b/samples/boot/insecure/build.gradle
deleted file mode 100644
index 2727c73c67..0000000000
--- a/samples/boot/insecure/build.gradle
+++ /dev/null
@@ -1,12 +0,0 @@
-apply from: BOOT_SAMPLE_GRADLE
-
-springBoot {
- mainClass = 'org.springframework.security.samples.InsecureApplication'
-}
-
-dependencies {
- compile "org.springframework.boot:spring-boot-starter-web",
- "org.springframework.boot:spring-boot-starter-thymeleaf"
-
- testCompile "org.springframework.boot:spring-boot-starter-test"
-}
diff --git a/samples/boot/insecure/spring-security-samples-boot-insecure.gradle b/samples/boot/insecure/spring-security-samples-boot-insecure.gradle
new file mode 100644
index 0000000000..556ebbb053
--- /dev/null
+++ b/samples/boot/insecure/spring-security-samples-boot-insecure.gradle
@@ -0,0 +1,8 @@
+apply plugin: 'io.spring.convention.spring-sample-boot'
+
+dependencies {
+ compile 'org.springframework.boot:spring-boot-starter-thymeleaf'
+ compile 'org.springframework.boot:spring-boot-starter-web'
+
+ testCompile 'org.springframework.boot:spring-boot-starter-test'
+}
diff --git a/samples/javaconfig/aspectj/build.gradle b/samples/javaconfig/aspectj/build.gradle
deleted file mode 100644
index 029e55272d..0000000000
--- a/samples/javaconfig/aspectj/build.gradle
+++ /dev/null
@@ -1,9 +0,0 @@
-
-dependencies {
- compile project(':spring-security-core'),
- project(':spring-security-config')
-
- aspectpath project(':spring-security-aspects')
-
- runtime project(':spring-security-aspects')
-}
diff --git a/samples/javaconfig/aspectj/spring-security-samples-javaconfig-aspectj.gradle b/samples/javaconfig/aspectj/spring-security-samples-javaconfig-aspectj.gradle
new file mode 100644
index 0000000000..92816e007e
--- /dev/null
+++ b/samples/javaconfig/aspectj/spring-security-samples-javaconfig-aspectj.gradle
@@ -0,0 +1,15 @@
+apply plugin: 'io.spring.convention.spring-sample'
+apply plugin: 'aspectj'
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-core')
+
+ aspectpath project(':spring-security-aspects')
+
+ runtime project(':spring-security-aspects')
+}
diff --git a/samples/javaconfig/concurrency/build.gradle b/samples/javaconfig/concurrency/build.gradle
deleted file mode 100644
index ccc48eb7aa..0000000000
--- a/samples/javaconfig/concurrency/build.gradle
+++ /dev/null
@@ -1,25 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-config"),
- project(":spring-security-samples-javaconfig-messages"),
- project(":spring-security-core"),
- project(":spring-security-web"),
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:log4j-over-slf4j:$slf4jVersion",
- "org.slf4j:jul-to-slf4j:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
-
- runtime "opensymphony:sitemesh:2.4.2",
- "cglib:cglib-nodep:$cglibVersion",
- 'ch.qos.logback:logback-classic:0.9.30'
-}
\ No newline at end of file
diff --git a/samples/javaconfig/concurrency/spring-security-samples-javaconfig-concurrency.gradle b/samples/javaconfig/concurrency/spring-security-samples-javaconfig-concurrency.gradle
new file mode 100644
index 0000000000..7a8e417d8e
--- /dev/null
+++ b/samples/javaconfig/concurrency/spring-security-samples-javaconfig-concurrency.gradle
@@ -0,0 +1,20 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-core')
+ compile project(':spring-security-samples-javaconfig-messages')
+ compile project(':spring-security-web')
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-webmvc'
+ compile slf4jDependencies
+
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+ providedCompile 'javax.servlet:javax.servlet-api:3.0.1'
+
+ runtime 'ch.qos.logback:logback-classic'
+ runtime 'opensymphony:sitemesh'
+}
diff --git a/samples/javaconfig/data/build.gradle b/samples/javaconfig/data/build.gradle
deleted file mode 100644
index 51b5dc17a7..0000000000
--- a/samples/javaconfig/data/build.gradle
+++ /dev/null
@@ -1,10 +0,0 @@
-dependencies {
- compile project(':spring-security-data'),
- project(':spring-security-config'),
- "org.springframework.data:spring-data-jpa:$springDataJpaVersion",
- "org.eclipse.persistence:javax.persistence:$javaPersistenceVersion",
- "org.hibernate:hibernate-entitymanager:$hibernateVersion",
- "org.hsqldb:hsqldb:$hsqlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
-}
\ No newline at end of file
diff --git a/samples/javaconfig/data/spring-security-samples-javaconfig-data.gradle b/samples/javaconfig/data/spring-security-samples-javaconfig-data.gradle
new file mode 100644
index 0000000000..94680d9b97
--- /dev/null
+++ b/samples/javaconfig/data/spring-security-samples-javaconfig-data.gradle
@@ -0,0 +1,12 @@
+apply plugin: 'io.spring.convention.spring-sample'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-data')
+ compile 'javax.validation:validation-api'
+ compile 'org.eclipse.persistence:javax.persistence'
+ compile 'org.hibernate:hibernate-entitymanager'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.hsqldb:hsqldb'
+ compile 'org.springframework.data:spring-data-jpa'
+}
diff --git a/samples/javaconfig/form/build.gradle b/samples/javaconfig/form/build.gradle
deleted file mode 100644
index 8f0b2a75a5..0000000000
--- a/samples/javaconfig/form/build.gradle
+++ /dev/null
@@ -1,27 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-config"),
- project(":spring-security-samples-javaconfig-messages"),
- project(":spring-security-core"),
- project(":spring-security-web"),
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:log4j-over-slf4j:$slf4jVersion",
- "org.slf4j:jul-to-slf4j:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
-
- runtime "opensymphony:sitemesh:2.4.2",
- "cglib:cglib-nodep:$cglibVersion",
- 'ch.qos.logback:logback-classic:0.9.30'
-
- integrationTestCompile gebDependencies
-}
\ No newline at end of file
diff --git a/samples/javaconfig/form/spring-security-samples-javaconfig-form.gradle b/samples/javaconfig/form/spring-security-samples-javaconfig-form.gradle
new file mode 100644
index 0000000000..0595e282ff
--- /dev/null
+++ b/samples/javaconfig/form/spring-security-samples-javaconfig-form.gradle
@@ -0,0 +1,22 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-core')
+ compile project(':spring-security-samples-javaconfig-messages')
+ compile project(':spring-security-web')
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-webmvc'
+ compile slf4jDependencies
+
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ runtime 'opensymphony:sitemesh'
+
+ integrationTestCompile gebDependencies
+}
diff --git a/samples/javaconfig/hellojs/build.gradle b/samples/javaconfig/hellojs/build.gradle
deleted file mode 100644
index 59215bd297..0000000000
--- a/samples/javaconfig/hellojs/build.gradle
+++ /dev/null
@@ -1,26 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-config"),
- project(":spring-security-samples-javaconfig-messages"),
- project(":spring-security-core"),
- project(":spring-security-web"),
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:log4j-over-slf4j:$slf4jVersion",
- "org.slf4j:jul-to-slf4j:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion",
- "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
-
- runtime "opensymphony:sitemesh:2.4.2",
- "cglib:cglib-nodep:$cglibVersion",
- 'ch.qos.logback:logback-classic:0.9.30'
-}
\ No newline at end of file
diff --git a/samples/javaconfig/hellojs/spring-security-samples-javaconfig-hellojs.gradle b/samples/javaconfig/hellojs/spring-security-samples-javaconfig-hellojs.gradle
new file mode 100644
index 0000000000..86700d410d
--- /dev/null
+++ b/samples/javaconfig/hellojs/spring-security-samples-javaconfig-hellojs.gradle
@@ -0,0 +1,20 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-core')
+ compile project(':spring-security-samples-javaconfig-messages')
+ compile project(':spring-security-web')
+ compile 'com.fasterxml.jackson.core:jackson-databind'
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-webmvc'
+ compile slf4jDependencies
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+
+ runtime 'opensymphony:sitemesh'
+}
diff --git a/samples/javaconfig/hellojs/src/main/java/org/springframework/security/samples/mvc/MessageJsonController.java b/samples/javaconfig/hellojs/src/main/java/org/springframework/security/samples/mvc/MessageJsonController.java
index c4cacfa01d..9f55aa820e 100644
--- a/samples/javaconfig/hellojs/src/main/java/org/springframework/security/samples/mvc/MessageJsonController.java
+++ b/samples/javaconfig/hellojs/src/main/java/org/springframework/security/samples/mvc/MessageJsonController.java
@@ -17,6 +17,7 @@ package org.springframework.security.samples.mvc;
import java.util.ArrayList;
import java.util.List;
+import java.util.Optional;
import javax.validation.Valid;
@@ -51,9 +52,9 @@ public class MessageJsonController {
}
@RequestMapping("{id}")
- public ResponseEntity view(@PathVariable Long id) {
- Message message = messageRepository.findOne(id);
- return new ResponseEntity(message, HttpStatus.OK);
+ public ResponseEntity> view(@PathVariable Long id) {
+ Optional message = messageRepository.findOne(id);
+ return new ResponseEntity<>(message, HttpStatus.OK);
}
@RequestMapping(method = RequestMethod.POST, consumes = "application/json")
diff --git a/samples/javaconfig/hellomvc/build.gradle b/samples/javaconfig/hellomvc/build.gradle
deleted file mode 100644
index 092faf1917..0000000000
--- a/samples/javaconfig/hellomvc/build.gradle
+++ /dev/null
@@ -1,27 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-config"),
- project(":spring-security-samples-javaconfig-messages"),
- project(":spring-security-core"),
- project(":spring-security-web"),
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:log4j-over-slf4j:$slf4jVersion",
- "org.slf4j:jul-to-slf4j:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
-
- runtime "opensymphony:sitemesh:2.4.2",
- "cglib:cglib-nodep:$cglibVersion",
- 'ch.qos.logback:logback-classic:0.9.30'
-
- testCompile project(":spring-security-test")
-}
\ No newline at end of file
diff --git a/samples/javaconfig/hellomvc/spring-security-samples-javaconfig-hellomvc.gradle b/samples/javaconfig/hellomvc/spring-security-samples-javaconfig-hellomvc.gradle
new file mode 100644
index 0000000000..f403ecb4f4
--- /dev/null
+++ b/samples/javaconfig/hellomvc/spring-security-samples-javaconfig-hellomvc.gradle
@@ -0,0 +1,21 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-core')
+ compile project(':spring-security-samples-javaconfig-messages')
+ compile project(':spring-security-web')
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-webmvc'
+ compile slf4jDependencies
+
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ runtime 'opensymphony:sitemesh'
+
+ testCompile project(':spring-security-test')
+}
diff --git a/samples/javaconfig/helloworld/build.gradle b/samples/javaconfig/helloworld/build.gradle
deleted file mode 100644
index 8b401bbd5c..0000000000
--- a/samples/javaconfig/helloworld/build.gradle
+++ /dev/null
@@ -1,16 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-config"),
- project(":spring-security-web"),
- jstlDependencies,
- "org.slf4j:jcl-over-slf4j:$slf4jVersion"
-
- runtime "ch.qos.logback:logback-classic:$logbackVersion"
-
- integrationTestCompile gebDependencies
-}
\ No newline at end of file
diff --git a/samples/javaconfig/helloworld/spring-security-samples-javaconfig-helloworld.gradle b/samples/javaconfig/helloworld/spring-security-samples-javaconfig-helloworld.gradle
new file mode 100644
index 0000000000..aa3713e3f9
--- /dev/null
+++ b/samples/javaconfig/helloworld/spring-security-samples-javaconfig-helloworld.gradle
@@ -0,0 +1,13 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-web')
+ compile jstlDependencies
+ compile slf4jDependencies
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+
+ integrationTestCompile gebDependencies
+}
diff --git a/samples/javaconfig/inmemory/build.gradle b/samples/javaconfig/inmemory/build.gradle
deleted file mode 100644
index 092faf1917..0000000000
--- a/samples/javaconfig/inmemory/build.gradle
+++ /dev/null
@@ -1,27 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-config"),
- project(":spring-security-samples-javaconfig-messages"),
- project(":spring-security-core"),
- project(":spring-security-web"),
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:log4j-over-slf4j:$slf4jVersion",
- "org.slf4j:jul-to-slf4j:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
-
- runtime "opensymphony:sitemesh:2.4.2",
- "cglib:cglib-nodep:$cglibVersion",
- 'ch.qos.logback:logback-classic:0.9.30'
-
- testCompile project(":spring-security-test")
-}
\ No newline at end of file
diff --git a/samples/javaconfig/inmemory/spring-security-samples-javaconfig-inmemory.gradle b/samples/javaconfig/inmemory/spring-security-samples-javaconfig-inmemory.gradle
new file mode 100644
index 0000000000..f403ecb4f4
--- /dev/null
+++ b/samples/javaconfig/inmemory/spring-security-samples-javaconfig-inmemory.gradle
@@ -0,0 +1,21 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-core')
+ compile project(':spring-security-samples-javaconfig-messages')
+ compile project(':spring-security-web')
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-webmvc'
+ compile slf4jDependencies
+
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ runtime 'opensymphony:sitemesh'
+
+ testCompile project(':spring-security-test')
+}
diff --git a/samples/javaconfig/jdbc/build.gradle b/samples/javaconfig/jdbc/build.gradle
deleted file mode 100644
index 8f0b2a75a5..0000000000
--- a/samples/javaconfig/jdbc/build.gradle
+++ /dev/null
@@ -1,27 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-config"),
- project(":spring-security-samples-javaconfig-messages"),
- project(":spring-security-core"),
- project(":spring-security-web"),
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:log4j-over-slf4j:$slf4jVersion",
- "org.slf4j:jul-to-slf4j:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
-
- runtime "opensymphony:sitemesh:2.4.2",
- "cglib:cglib-nodep:$cglibVersion",
- 'ch.qos.logback:logback-classic:0.9.30'
-
- integrationTestCompile gebDependencies
-}
\ No newline at end of file
diff --git a/samples/javaconfig/jdbc/spring-security-samples-javaconfig-jdbc.gradle b/samples/javaconfig/jdbc/spring-security-samples-javaconfig-jdbc.gradle
new file mode 100644
index 0000000000..30605b9ca6
--- /dev/null
+++ b/samples/javaconfig/jdbc/spring-security-samples-javaconfig-jdbc.gradle
@@ -0,0 +1,21 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-core')
+ compile project(':spring-security-samples-javaconfig-messages')
+ compile project(':spring-security-web')
+ compile 'org.springframework:spring-webmvc'
+ compile 'org.springframework:spring-jdbc'
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile slf4jDependencies
+
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ runtime 'opensymphony:sitemesh'
+
+ integrationTestCompile gebDependencies
+}
diff --git a/samples/javaconfig/ldap/build.gradle b/samples/javaconfig/ldap/build.gradle
deleted file mode 100644
index 2faa1e985b..0000000000
--- a/samples/javaconfig/ldap/build.gradle
+++ /dev/null
@@ -1,29 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-ldap"),
- apachedsDependencies,
- project(":spring-security-config"),
- project(":spring-security-samples-javaconfig-messages"),
- project(":spring-security-core"),
- project(":spring-security-web"),
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:log4j-over-slf4j:$slf4jVersion",
- "org.slf4j:jul-to-slf4j:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
-
- runtime "opensymphony:sitemesh:2.4.2",
- "cglib:cglib-nodep:$cglibVersion",
- 'ch.qos.logback:logback-classic:0.9.30'
-
- integrationTestCompile gebDependencies
-}
\ No newline at end of file
diff --git a/samples/javaconfig/ldap/spring-security-samples-javaconfig-ldap.gradle b/samples/javaconfig/ldap/spring-security-samples-javaconfig-ldap.gradle
new file mode 100644
index 0000000000..36f3f79048
--- /dev/null
+++ b/samples/javaconfig/ldap/spring-security-samples-javaconfig-ldap.gradle
@@ -0,0 +1,23 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-core')
+ compile project(':spring-security-ldap')
+ compile project(':spring-security-samples-javaconfig-messages')
+ compile project(':spring-security-web')
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-webmvc'
+ compile apachedsDependencies
+ compile slf4jDependencies
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+
+ runtime 'opensymphony:sitemesh'
+
+ integrationTestCompile gebDependencies
+}
diff --git a/samples/javaconfig/messages/build.gradle b/samples/javaconfig/messages/build.gradle
deleted file mode 100644
index 721b3cd033..0000000000
--- a/samples/javaconfig/messages/build.gradle
+++ /dev/null
@@ -1,29 +0,0 @@
-sonarqube.skipProject = true
-
-dependencies {
- provided "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- compile project(":spring-security-web"),
- project(":spring-security-config"),
- "org.hsqldb:hsqldb:$hsqlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion",
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-orm:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-aop:$springVersion",
- "org.springframework:spring-tx:$springVersion",
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-instrument:$springVersion",
- "org.springframework:spring-core:$springVersion",
- "org.springframework:spring-aspects:$springVersion",
- "org.thymeleaf:thymeleaf-spring4:$thymeleafVersion",
- "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:2.0.4",
- "org.eclipse.persistence:javax.persistence:$javaPersistenceVersion"
- compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") {
- exclude group:'javassist', module: 'javassist'
- }
- compile("org.springframework.data:spring-data-jpa:$springDataJpaVersion") {
- exclude group:'org.aspectj', module:'aspectjrt'
- }
-}
diff --git a/samples/javaconfig/messages/spring-security-samples-javaconfig-messages.gradle b/samples/javaconfig/messages/spring-security-samples-javaconfig-messages.gradle
new file mode 100644
index 0000000000..4be98f7716
--- /dev/null
+++ b/samples/javaconfig/messages/spring-security-samples-javaconfig-messages.gradle
@@ -0,0 +1,29 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-web')
+ compile 'javax.validation:validation-api'
+ compile 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:2.0.4'
+ compile 'org.eclipse.persistence:javax.persistence'
+ compile('org.hibernate:hibernate-entitymanager') {
+ exclude group:'javassist', module: 'javassist'
+ }
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.hsqldb:hsqldb'
+ compile('org.springframework.data:spring-data-jpa') {
+ exclude group:'org.aspectj', module:'aspectjrt'
+ }
+ compile 'org.springframework:spring-aop'
+ compile 'org.springframework:spring-aspects'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-core'
+ compile 'org.springframework:spring-instrument'
+ compile 'org.springframework:spring-orm'
+ compile 'org.springframework:spring-tx'
+ compile 'org.springframework:spring-webmvc'
+ compile 'org.thymeleaf:thymeleaf-spring5'
+
+ provided 'javax.servlet:javax.servlet-api'
+}
diff --git a/samples/javaconfig/messages/src/main/java/org/springframework/security/samples/mvc/config/WebMvcConfiguration.java b/samples/javaconfig/messages/src/main/java/org/springframework/security/samples/mvc/config/WebMvcConfiguration.java
index 916275901b..133d5bafc4 100644
--- a/samples/javaconfig/messages/src/main/java/org/springframework/security/samples/mvc/config/WebMvcConfiguration.java
+++ b/samples/javaconfig/messages/src/main/java/org/springframework/security/samples/mvc/config/WebMvcConfiguration.java
@@ -28,9 +28,9 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.thymeleaf.TemplateEngine;
-import org.thymeleaf.spring4.SpringTemplateEngine;
-import org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver;
-import org.thymeleaf.spring4.view.ThymeleafViewResolver;
+import org.thymeleaf.spring5.SpringTemplateEngine;
+import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver;
+import org.thymeleaf.spring5.view.ThymeleafViewResolver;
import org.thymeleaf.templatemode.TemplateMode;
@EnableWebMvc
@@ -65,7 +65,7 @@ public class WebMvcConfiguration extends WebMvcConfigurerAdapter {
}
@Bean
- public TemplateEngine templateEngine() {
+ public SpringTemplateEngine templateEngine() {
SpringTemplateEngine engine = new SpringTemplateEngine();
engine.setEnableSpringELCompiler(true);
engine.setTemplateResolver(templateResolver());
diff --git a/samples/javaconfig/openid/build.gradle b/samples/javaconfig/openid/build.gradle
deleted file mode 100644
index ebe90a42df..0000000000
--- a/samples/javaconfig/openid/build.gradle
+++ /dev/null
@@ -1,27 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-config"),
- project(":spring-security-openid"),
- project(":spring-security-samples-javaconfig-messages"),
- project(":spring-security-core"),
- project(":spring-security-web"),
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:log4j-over-slf4j:$slf4jVersion",
- "org.slf4j:jul-to-slf4j:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
-
- runtime "opensymphony:sitemesh:2.4.2",
- "cglib:cglib-nodep:$cglibVersion",
- 'ch.qos.logback:logback-classic:0.9.30',
- "net.sourceforge.nekohtml:nekohtml:1.9.10"
-}
\ No newline at end of file
diff --git a/samples/javaconfig/openid/spring-security-samples-javaconfig-openid.gradle b/samples/javaconfig/openid/spring-security-samples-javaconfig-openid.gradle
new file mode 100644
index 0000000000..899b99c229
--- /dev/null
+++ b/samples/javaconfig/openid/spring-security-samples-javaconfig-openid.gradle
@@ -0,0 +1,21 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-core')
+ compile project(':spring-security-openid')
+ compile project(':spring-security-samples-javaconfig-messages')
+ compile project(':spring-security-web')
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-webmvc'
+ compile slf4jDependencies
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+
+ runtime 'net.sourceforge.nekohtml:nekohtml'
+ runtime 'opensymphony:sitemesh'
+}
diff --git a/samples/javaconfig/preauth/build.gradle b/samples/javaconfig/preauth/build.gradle
deleted file mode 100644
index ccc48eb7aa..0000000000
--- a/samples/javaconfig/preauth/build.gradle
+++ /dev/null
@@ -1,25 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-config"),
- project(":spring-security-samples-javaconfig-messages"),
- project(":spring-security-core"),
- project(":spring-security-web"),
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:log4j-over-slf4j:$slf4jVersion",
- "org.slf4j:jul-to-slf4j:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
-
- runtime "opensymphony:sitemesh:2.4.2",
- "cglib:cglib-nodep:$cglibVersion",
- 'ch.qos.logback:logback-classic:0.9.30'
-}
\ No newline at end of file
diff --git a/samples/javaconfig/preauth/spring-security-samples-javaconfig-preauth.gradle b/samples/javaconfig/preauth/spring-security-samples-javaconfig-preauth.gradle
new file mode 100644
index 0000000000..646b6878d0
--- /dev/null
+++ b/samples/javaconfig/preauth/spring-security-samples-javaconfig-preauth.gradle
@@ -0,0 +1,19 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-core')
+ compile project(':spring-security-samples-javaconfig-messages')
+ compile project(':spring-security-web')
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-webmvc'
+ compile slf4jDependencies
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+
+ runtime 'opensymphony:sitemesh'
+}
diff --git a/samples/javaconfig/rememberme/build.gradle b/samples/javaconfig/rememberme/build.gradle
deleted file mode 100644
index ccc48eb7aa..0000000000
--- a/samples/javaconfig/rememberme/build.gradle
+++ /dev/null
@@ -1,25 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-config"),
- project(":spring-security-samples-javaconfig-messages"),
- project(":spring-security-core"),
- project(":spring-security-web"),
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:log4j-over-slf4j:$slf4jVersion",
- "org.slf4j:jul-to-slf4j:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
-
- runtime "opensymphony:sitemesh:2.4.2",
- "cglib:cglib-nodep:$cglibVersion",
- 'ch.qos.logback:logback-classic:0.9.30'
-}
\ No newline at end of file
diff --git a/samples/javaconfig/rememberme/spring-security-samples-javaconfig-rememberme.gradle b/samples/javaconfig/rememberme/spring-security-samples-javaconfig-rememberme.gradle
new file mode 100644
index 0000000000..4d52c8ec1e
--- /dev/null
+++ b/samples/javaconfig/rememberme/spring-security-samples-javaconfig-rememberme.gradle
@@ -0,0 +1,19 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-core')
+ compile project(':spring-security-samples-javaconfig-messages')
+ compile project(':spring-security-web')
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-webmvc'
+ compile slf4jDependencies
+
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ runtime 'opensymphony:sitemesh'
+}
diff --git a/samples/javaconfig/x509/build.gradle b/samples/javaconfig/x509/build.gradle
deleted file mode 100644
index 0405110d13..0000000000
--- a/samples/javaconfig/x509/build.gradle
+++ /dev/null
@@ -1,26 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-config"),
- project(":spring-security-samples-javaconfig-messages"),
- project(":spring-security-core"),
- project(":spring-security-web"),
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:log4j-over-slf4j:$slf4jVersion",
- "org.slf4j:jul-to-slf4j:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
-
- runtime "opensymphony:sitemesh:2.4.2",
- "cglib:cglib-nodep:$cglibVersion",
- 'ch.qos.logback:logback-classic:0.9.30'
-}
\ No newline at end of file
diff --git a/samples/javaconfig/x509/spring-security-samples-javaconfig-x509.gradle b/samples/javaconfig/x509/spring-security-samples-javaconfig-x509.gradle
new file mode 100644
index 0000000000..ea4910848f
--- /dev/null
+++ b/samples/javaconfig/x509/spring-security-samples-javaconfig-x509.gradle
@@ -0,0 +1,22 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-core')
+ compile project(':spring-security-samples-javaconfig-messages')
+ compile project(':spring-security-web')
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.slf4j:jcl-over-slf4j'
+ compile 'org.slf4j:jul-to-slf4j'
+ compile 'org.slf4j:log4j-over-slf4j'
+ compile 'org.slf4j:slf4j-api'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-webmvc'
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+
+ runtime 'opensymphony:sitemesh'
+}
diff --git a/samples/xml/aspectj/aspectj.gradle b/samples/xml/aspectj/aspectj.gradle
deleted file mode 100644
index 470b537601..0000000000
--- a/samples/xml/aspectj/aspectj.gradle
+++ /dev/null
@@ -1,9 +0,0 @@
-
-dependencies {
- compile project(':spring-security-core')
-
- aspectpath project(':spring-security-aspects')
-
- runtime project(':spring-security-config'),
- project(':spring-security-aspects')
-}
diff --git a/samples/xml/aspectj/spring-security-samples-xml-aspectj.gradle b/samples/xml/aspectj/spring-security-samples-xml-aspectj.gradle
new file mode 100644
index 0000000000..d869f63296
--- /dev/null
+++ b/samples/xml/aspectj/spring-security-samples-xml-aspectj.gradle
@@ -0,0 +1,11 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+apply plugin: 'aspectj'
+
+dependencies {
+ compile project(':spring-security-core')
+
+ aspectpath project(':spring-security-aspects')
+
+ runtime project(':spring-security-aspects')
+ runtime project(':spring-security-config')
+}
diff --git a/samples/xml/cas/cassample/cassample.gradle b/samples/xml/cas/cassample/spring-security-samples-xml-cassample.gradle
similarity index 74%
rename from samples/xml/cas/cassample/cassample.gradle
rename to samples/xml/cas/cassample/spring-security-samples-xml-cassample.gradle
index b6dea3b9f1..d9babd2dbe 100644
--- a/samples/xml/cas/cassample/cassample.gradle
+++ b/samples/xml/cas/cassample/spring-security-samples-xml-cassample.gradle
@@ -1,11 +1,8 @@
-// CAS sample build file
-
+apply plugin: 'io.spring.convention.spring-sample'
apply plugin: 'war'
apply plugin: 'jetty'
-apply plugin: 'groovy'
def excludeModules = ['spring-security-acl', 'jsr250-api', 'spring-jdbc', 'spring-tx']
-def jettyVersion = '8.1.9.v20130131'
def keystore = "$rootDir/samples/certificates/server.jks"
def password = 'password'
@@ -26,32 +23,31 @@ sourceSets {
eclipse.classpath.plusConfigurations += [configurations.integrationTestRuntime]
dependencies {
- providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
+ compile project(':spring-security-cas')
+ compile project(':spring-security-core')
+ compile 'org.jasig.cas.client:cas-client-core'
- compile project(':spring-security-core'),
- project(':spring-security-cas'),
- "org.jasig.cas.client:cas-client-core:$casClientVersion"
+ providedCompile 'javax.servlet:javax.servlet-api'
- runtime project(':spring-security-web'),
- project(':spring-security-config'),
- "org.springframework:spring-context-support:$springVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "ch.qos.logback:logback-classic:$logbackVersion",
- "net.sf.ehcache:ehcache:$ehcacheVersion"
+ runtime project(':spring-security-config')
+ runtime project(':spring-security-web')
+ runtime 'ch.qos.logback:logback-classic'
+ runtime 'net.sf.ehcache:ehcache'
+ runtime 'org.slf4j:jcl-over-slf4j'
+ runtime 'org.springframework:spring-context-support'
- integrationTestCompile project(':spring-security-cas'),
- "org.seleniumhq.selenium:selenium-htmlunit-driver:$seleniumVersion",
- "org.gebish:geb-spock:$gebVersion",
- 'commons-httpclient:commons-httpclient:3.1',
- "org.eclipse.jetty:jetty-server:$jettyVersion",
- "org.eclipse.jetty:jetty-servlet:$jettyVersion",
- "org.codehaus.groovy:groovy:$groovyVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- spockDependencies
+ integrationTestCompile project(':spring-security-cas')
+ integrationTestCompile gebDependencies
+ integrationTestCompile seleniumDependencies
+ integrationTestCompile spockDependencies
+ integrationTestCompile 'org.codehaus.groovy:groovy'
+ integrationTestCompile 'org.eclipse.jetty:jetty-server'
+ integrationTestCompile 'org.eclipse.jetty:jetty-servlet'
+ integrationTestCompile 'org.slf4j:jcl-over-slf4j'
}
-[jettyRun, jettyRunWar]*.configure {
- contextPath = "/cas-sample"
+[project.tasks.jettyRun, project.tasks.jettyRunWar]*.configure {
+ contextPath = '/cas-sample'
def httpConnector = jettyRunWar.class.classLoader.loadClass('org.mortbay.jetty.nio.SelectChannelConnector').newInstance()
httpConnector.port = 8080
httpConnector.confidentialPort = 8443
@@ -74,6 +70,7 @@ task cas (dependsOn: [jettyRunWar]) {
task casServer(dependsOn: ':spring-security-samples-xml-casserver:casServer') {
}
+
integrationTest.dependsOn cas
integrationTest.doFirst {
def casServiceHost = jettyRunWar.httpsHost
@@ -105,7 +102,7 @@ gradle.taskGraph.whenReady {graph ->
if(graph.hasTask(integrationTest)) {
tasks.getByPath(':spring-security-samples-xml-casserver:casServerOverlay').logLevel = 'ERROR'
jettyRunWar {
- additionalRuntimeJars += file("src/integration-test/resources")
+ additionalRuntimeJars += file('src/integration-test/resources')
daemon = true
}
diff --git a/samples/xml/cas/cassample/src/integration-test/groovy/org/springframework/security/samples/cas/JettyCasService.groovy b/samples/xml/cas/cassample/src/integration-test/groovy/org/springframework/security/samples/cas/JettyCasService.groovy
index 6ba5c63fa1..2e3f961edd 100644
--- a/samples/xml/cas/cassample/src/integration-test/groovy/org/springframework/security/samples/cas/JettyCasService.groovy
+++ b/samples/xml/cas/cassample/src/integration-test/groovy/org/springframework/security/samples/cas/JettyCasService.groovy
@@ -13,23 +13,25 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.security.samples.cas;
+package org.springframework.security.samples.cas
-import java.io.IOException
+import org.eclipse.jetty.http.HttpVersion
+import org.eclipse.jetty.server.HttpConfiguration
+import org.eclipse.jetty.server.HttpConnectionFactory
+import org.eclipse.jetty.server.SecureRequestCustomizer
+import org.eclipse.jetty.server.ServerConnector
+import org.eclipse.jetty.server.SslConnectionFactory
+import org.eclipse.jetty.util.ssl.SslContextFactory;
import javax.servlet.ServletException
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
-import org.apache.commons.httpclient.HttpClient
-import org.apache.commons.httpclient.methods.GetMethod;
import org.eclipse.jetty.server.Request
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.server.handler.AbstractHandler
-import org.eclipse.jetty.server.ssl.SslSelectChannelConnector
import org.jasig.cas.client.proxy.ProxyGrantingTicketStorage;
import org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl;
-import org.jasig.cas.client.validation.Assertion
import org.jasig.cas.client.validation.Cas20ProxyTicketValidator;
/**
@@ -54,6 +56,7 @@ class JettyCasService extends Server {
* @return
*/
def init(String casServerUrl) {
+ println "Initializing to " + casServerUrl
ProxyGrantingTicketStorage storage = new ProxyGrantingTicketStorageImpl()
validator = new Cas20ProxyTicketValidator(casServerUrl)
validator.setAcceptAnyProxy(true)
@@ -61,12 +64,31 @@ class JettyCasService extends Server {
validator.setProxyCallbackUrl(absoluteUrl('callback'))
String password = System.getProperty('javax.net.ssl.trustStorePassword','password')
- SslSelectChannelConnector ssl_connector = new SslSelectChannelConnector()
- ssl_connector.setPort(port)
- ssl_connector.setKeystore(getTrustStore())
- ssl_connector.setPassword(password)
- ssl_connector.setKeyPassword(password)
- addConnector(ssl_connector)
+
+
+ SslContextFactory sslContextFactory = new SslContextFactory();
+ sslContextFactory.setKeyStorePath(getTrustStore());
+ sslContextFactory.setKeyStorePassword(password);
+ sslContextFactory.setKeyManagerPassword(password);
+
+ HttpConfiguration http_config = new HttpConfiguration();
+ http_config.setSecureScheme("https");
+ http_config.setSecurePort(availablePort());
+ http_config.setOutputBufferSize(32768);
+
+ HttpConfiguration https_config = new HttpConfiguration(http_config);
+ SecureRequestCustomizer src = new SecureRequestCustomizer();
+ src.setStsMaxAge(2000);
+ src.setStsIncludeSubDomains(true);
+ https_config.addCustomizer(src);
+
+ ServerConnector https = new ServerConnector(this,
+ new SslConnectionFactory(sslContextFactory,HttpVersion.HTTP_1_1.asString()),
+ new HttpConnectionFactory(https_config));
+ https.setPort(port);
+ https.setIdleTimeout(500000);
+
+ addConnector(https)
setHandler(new AbstractHandler() {
public void handle(String target, Request baseRequest,
HttpServletRequest request, HttpServletResponse response)
@@ -121,4 +143,4 @@ class JettyCasService extends Server {
server.close()
port
}
-}
\ No newline at end of file
+}
diff --git a/samples/xml/cas/casserver/casserver.gradle b/samples/xml/cas/casserver/spring-security-samples-xml-casserver.gradle
similarity index 97%
rename from samples/xml/cas/casserver/casserver.gradle
rename to samples/xml/cas/casserver/spring-security-samples-xml-casserver.gradle
index 1316212e7f..65aa0064d6 100644
--- a/samples/xml/cas/casserver/casserver.gradle
+++ b/samples/xml/cas/casserver/spring-security-samples-xml-casserver.gradle
@@ -1,6 +1,6 @@
import org.apache.tools.ant.filters.ReplaceTokens
-apply plugin: 'jetty'
+apply plugin: 'io.spring.convention.spring-sample'
def keystore = "$rootDir/samples/certificates/server.jks"
def password = 'password'
diff --git a/samples/xml/contacts/contacts.gradle b/samples/xml/contacts/contacts.gradle
deleted file mode 100644
index 57aeb01ee6..0000000000
--- a/samples/xml/contacts/contacts.gradle
+++ /dev/null
@@ -1,29 +0,0 @@
-// Contacts sample build file
-
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
- providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- compile project(':spring-security-core'),
- project(':spring-security-acl'),
- "org.springframework:spring-aop:$springVersion",
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.springframework:spring-tx:$springVersion",
- "org.springframework:spring-web:$springVersion",
- "org.springframework:spring-webmvc:$springVersion"
-
- runtime project(':spring-security-web'),
- project(':spring-security-config'),
- project(':spring-security-taglibs'),
- "org.springframework:spring-context-support:$springVersion",
- jstlDependencies,
- "org.hsqldb:hsqldb:$hsqlVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "ch.qos.logback:logback-classic:$logbackVersion",
- "net.sf.ehcache:ehcache:$ehcacheVersion"
-
- integrationTestCompile gebDependencies
-}
\ No newline at end of file
diff --git a/samples/xml/contacts/spring-security-samples-xml-contacts.gradle b/samples/xml/contacts/spring-security-samples-xml-contacts.gradle
new file mode 100644
index 0000000000..3c0f7f557f
--- /dev/null
+++ b/samples/xml/contacts/spring-security-samples-xml-contacts.gradle
@@ -0,0 +1,28 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-acl')
+ compile project(':spring-security-core')
+ compile slf4jDependencies
+ compile 'org.springframework:spring-aop'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-tx'
+ compile 'org.springframework:spring-web'
+ compile 'org.springframework:spring-webmvc'
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ runtime project(':spring-security-config')
+ runtime project(':spring-security-taglibs')
+ runtime project(':spring-security-web')
+ runtime jstlDependencies
+ runtime 'ch.qos.logback:logback-classic'
+ runtime 'net.sf.ehcache:ehcache'
+ runtime 'org.hsqldb:hsqldb'
+ runtime 'org.slf4j:jcl-over-slf4j'
+ runtime 'org.springframework:spring-context-support'
+
+ integrationTestCompile gebDependencies
+}
diff --git a/samples/xml/dms/dms.gradle b/samples/xml/dms/dms.gradle
deleted file mode 100644
index df1a81e69d..0000000000
--- a/samples/xml/dms/dms.gradle
+++ /dev/null
@@ -1,16 +0,0 @@
-
-dependencies {
- compile project(':spring-security-core'),
- project(':spring-security-acl'),
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-tx:$springVersion",
- "org.springframework:spring-jdbc:$springVersion"
-
- testCompile "org.springframework:spring-context:$springVersion"
-
- runtime project(':spring-security-config'),
- "org.hsqldb:hsqldb:$hsqlVersion",
- "org.springframework:spring-context-support:$springVersion"
-
- optional "net.sf.ehcache:ehcache:$ehcacheVersion"
-}
diff --git a/samples/xml/dms/spring-security-samples-xml-dms.gradle b/samples/xml/dms/spring-security-samples-xml-dms.gradle
new file mode 100644
index 0000000000..51a003853b
--- /dev/null
+++ b/samples/xml/dms/spring-security-samples-xml-dms.gradle
@@ -0,0 +1,17 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-acl')
+ compile project(':spring-security-core')
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-tx'
+
+ optional 'net.sf.ehcache:ehcache'
+
+ runtime project(':spring-security-config')
+ runtime 'org.hsqldb:hsqldb'
+ runtime 'org.springframework:spring-context-support'
+
+ testCompile 'org.springframework:spring-context'
+}
diff --git a/samples/xml/gae/gae.gradle b/samples/xml/gae/gae.gradle
deleted file mode 100644
index 6caf0a337c..0000000000
--- a/samples/xml/gae/gae.gradle
+++ /dev/null
@@ -1,52 +0,0 @@
-apply plugin: 'war'
-apply plugin: 'jetty'
-apply plugin: 'appengine'
-
-def gaeVersion="1.9.23"
-
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.google.appengine:gradle-appengine-plugin:1.9.23'
- }
-}
-
-appengine {
- downloadSdk = true
-}
-
-// Remove logback as it causes security issues with GAE.
-configurations.runtime.exclude(group: 'ch.qos.logback')
-
-dependencies {
- appengineSdk "com.google.appengine:appengine-java-sdk:$gaeVersion"
-
- providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- compile project(':spring-security-core'),
- project(':spring-security-web'),
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-web:$springVersion",
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-context-support:$springVersion",
- "com.google.appengine:appengine-api-1.0-sdk:$gaeVersion",
- 'javax.validation:validation-api:1.0.0.GA',
- 'org.hibernate:hibernate-validator:4.2.0.Final',
- "org.slf4j:slf4j-api:$slf4jVersion"
-
- runtime project(':spring-security-config'),
- project(':spring-security-taglibs'),
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "org.slf4j:slf4j-jdk14:$slf4jVersion",
- jstlDependencies
- testCompile "com.google.appengine:appengine-testing:$gaeVersion"
-
- testRuntime "com.google.appengine:appengine-api-labs:$gaeVersion",
- "com.google.appengine:appengine-api-stubs:$gaeVersion"
-
-}
-
-appengineRun.onlyIf { !gradle.taskGraph.hasTask(appengineFunctionalTest) }
\ No newline at end of file
diff --git a/samples/xml/gae/spring-security-samples-xml-gae.gradle b/samples/xml/gae/spring-security-samples-xml-gae.gradle
new file mode 100644
index 0000000000..4ab8a16479
--- /dev/null
+++ b/samples/xml/gae/spring-security-samples-xml-gae.gradle
@@ -0,0 +1,47 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+apply plugin: 'appengine'
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath "com.google.appengine:gradle-appengine-plugin:$gaeVersion"
+ }
+}
+
+appengine {
+ downloadSdk = true
+}
+
+// Remove logback as it causes security issues with GAE.
+configurations.runtime.exclude(group: 'ch.qos.logback')
+
+dependencies {
+ appengineSdk "com.google.appengine:appengine-java-sdk:$gaeVersion"
+
+ compile project(':spring-security-core')
+ compile project(':spring-security-taglibs')
+ compile project(':spring-security-web')
+ compile jstlDependencies
+ compile slf4jDependencies
+ compile "com.google.appengine:appengine-api-1.0-sdk:$gaeVersion"
+ compile "com.google.appengine:appengine-api-stubs:$gaeVersion"
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-context-support'
+ compile 'org.springframework:spring-web'
+ compile 'org.springframework:spring-webmvc'
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ runtime project(':spring-security-config')
+
+ testCompile "com.google.appengine:appengine-testing:$gaeVersion"
+
+ testRuntime "com.google.appengine:appengine-api-labs:$gaeVersion"
+}
+
+appengineRun.onlyIf { !gradle.taskGraph.hasTask(appengineFunctionalTest) }
diff --git a/samples/xml/helloworld/build.gradle b/samples/xml/helloworld/build.gradle
deleted file mode 100644
index 8b401bbd5c..0000000000
--- a/samples/xml/helloworld/build.gradle
+++ /dev/null
@@ -1,16 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-config"),
- project(":spring-security-web"),
- jstlDependencies,
- "org.slf4j:jcl-over-slf4j:$slf4jVersion"
-
- runtime "ch.qos.logback:logback-classic:$logbackVersion"
-
- integrationTestCompile gebDependencies
-}
\ No newline at end of file
diff --git a/samples/xml/helloworld/spring-security-samples-xml-helloworld.gradle b/samples/xml/helloworld/spring-security-samples-xml-helloworld.gradle
new file mode 100644
index 0000000000..f52da5e033
--- /dev/null
+++ b/samples/xml/helloworld/spring-security-samples-xml-helloworld.gradle
@@ -0,0 +1,13 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-config')
+ compile project(':spring-security-web')
+ compile jstlDependencies
+ compile slf4jDependencies
+ compile 'javax.servlet.jsp:javax.servlet.jsp-api'
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ integrationTestCompile gebDependencies
+}
diff --git a/samples/xml/insecure/build.gradle b/samples/xml/insecure/build.gradle
deleted file mode 100644
index 073d7aabb2..0000000000
--- a/samples/xml/insecure/build.gradle
+++ /dev/null
@@ -1,14 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile jstlDependencies,
- "org.slf4j:jcl-over-slf4j:$slf4jVersion"
-
- runtime "ch.qos.logback:logback-classic:$logbackVersion"
-
- integrationTestCompile gebDependencies
-}
\ No newline at end of file
diff --git a/samples/xml/insecure/spring-security-samples-xml-insecure.gradle b/samples/xml/insecure/spring-security-samples-xml-insecure.gradle
new file mode 100644
index 0000000000..9710669975
--- /dev/null
+++ b/samples/xml/insecure/spring-security-samples-xml-insecure.gradle
@@ -0,0 +1,11 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile jstlDependencies
+ compile slf4jDependencies
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+
+ integrationTestCompile gebDependencies
+}
diff --git a/samples/xml/insecuremvc/build.gradle b/samples/xml/insecuremvc/build.gradle
deleted file mode 100644
index 44c188c89c..0000000000
--- a/samples/xml/insecuremvc/build.gradle
+++ /dev/null
@@ -1,22 +0,0 @@
-apply from: WAR_SAMPLE_GRADLE
-
-dependencies {
-
- providedCompile "javax.servlet:javax.servlet-api:3.0.1",
- 'javax.servlet.jsp:jsp-api:2.1'
-
- compile project(":spring-security-samples-javaconfig-messages"),
- "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion",
- "org.slf4j:log4j-over-slf4j:$slf4jVersion",
- "org.slf4j:jul-to-slf4j:$slf4jVersion",
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "javax.validation:validation-api:$validationApiVersion",
- "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
-
- runtime "opensymphony:sitemesh:2.4.2",
- "cglib:cglib-nodep:$cglibVersion",
- 'ch.qos.logback:logback-classic:0.9.30'
-}
\ No newline at end of file
diff --git a/samples/xml/insecuremvc/spring-security-samples-xml-insecuremvc.gradle b/samples/xml/insecuremvc/spring-security-samples-xml-insecuremvc.gradle
new file mode 100644
index 0000000000..d311bb56ce
--- /dev/null
+++ b/samples/xml/insecuremvc/spring-security-samples-xml-insecuremvc.gradle
@@ -0,0 +1,16 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-samples-javaconfig-messages')
+ compile slf4jDependencies
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'javax.validation:validation-api'
+ compile 'org.hibernate:hibernate-validator'
+ compile 'org.springframework:spring-jdbc'
+ compile 'org.springframework:spring-webmvc'
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+ providedCompile 'javax.servlet.jsp:javax.servlet.jsp-api'
+
+ runtime 'opensymphony:sitemesh'
+}
diff --git a/samples/xml/jaas/jaas.gradle b/samples/xml/jaas/jaas.gradle
deleted file mode 100644
index d786a22779..0000000000
--- a/samples/xml/jaas/jaas.gradle
+++ /dev/null
@@ -1,31 +0,0 @@
-// JAAS sample build file
-apply from: WAR_SAMPLE_GRADLE
-
-def excludeModules = ['spring-security-acl', 'jsr250-api', 'ehcache', 'spring-jdbc', 'spring-tx']
-
-configurations {
- excludeModules.each {name ->
- runtime.exclude module: name
- }
-
- runtime.exclude group: 'org.aspectj'
-}
-
-dependencies {
- providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- compile project(':spring-security-core'),
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-web:$springVersion"
-
- runtime project(':spring-security-web'),
- project(':spring-security-config'),
- project(':spring-security-taglibs'),
- "org.springframework:spring-context-support:$springVersion",
- jstlDependencies,
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "ch.qos.logback:logback-classic:$logbackVersion"
-
- integrationTestCompile gebDependencies
-}
\ No newline at end of file
diff --git a/samples/xml/jaas/spring-security-samples-xml-jaas.gradle b/samples/xml/jaas/spring-security-samples-xml-jaas.gradle
new file mode 100644
index 0000000000..8ea809d42d
--- /dev/null
+++ b/samples/xml/jaas/spring-security-samples-xml-jaas.gradle
@@ -0,0 +1,19 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-web'
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ runtime project(':spring-security-config')
+ runtime project(':spring-security-taglibs')
+ runtime project(':spring-security-web')
+ runtime jstlDependencies
+ runtime slf4jDependencies
+ runtime 'org.springframework:spring-context-support'
+
+ integrationTestCompile gebDependencies
+}
diff --git a/samples/xml/ldap/ldap.gradle b/samples/xml/ldap/ldap.gradle
deleted file mode 100644
index 26ed39147d..0000000000
--- a/samples/xml/ldap/ldap.gradle
+++ /dev/null
@@ -1,28 +0,0 @@
-// LDAP sample build file
-apply from: WAR_SAMPLE_GRADLE
-
-def excludeModules = ['spring-security-acl', 'jsr250-api', 'ehcache', 'spring-jdbc', 'ldapsdk']
-
-configurations {
- excludeModules.each {name ->
- runtime.exclude module: name
- }
-
- runtime.exclude group: 'org.aspectj'
-}
-
-dependencies {
- compile project(':spring-security-taglibs'),
- jstlDependencies
-
- runtime project(':spring-security-web'),
- project(':spring-security-config'),
- project(':spring-security-ldap'),
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "ch.qos.logback:logback-classic:$logbackVersion",
- apachedsDependencies
-
- providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- integrationTestCompile gebDependencies
-}
\ No newline at end of file
diff --git a/samples/xml/ldap/spring-security-samples-xml-ldap.gradle b/samples/xml/ldap/spring-security-samples-xml-ldap.gradle
new file mode 100644
index 0000000000..5fc778106e
--- /dev/null
+++ b/samples/xml/ldap/spring-security-samples-xml-ldap.gradle
@@ -0,0 +1,16 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-taglibs')
+ compile jstlDependencies
+
+ runtime project(':spring-security-web')
+ runtime project(':spring-security-config')
+ runtime project(':spring-security-ldap')
+ runtime apachedsDependencies
+ runtime slf4jDependencies
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ integrationTestCompile gebDependencies
+}
diff --git a/samples/xml/openid/openid.gradle b/samples/xml/openid/openid.gradle
deleted file mode 100644
index 9aade821a6..0000000000
--- a/samples/xml/openid/openid.gradle
+++ /dev/null
@@ -1,20 +0,0 @@
-// OpenID sample build file
-
-apply plugin: 'war'
-apply plugin: 'jetty'
-
-dependencies {
- compile project(':spring-security-core'),
- project(':spring-security-openid'),
- "org.springframework:spring-webmvc:$springVersion"
-
- providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- runtime project(':spring-security-config'),
- project(':spring-security-taglibs'),
- jstlDependencies,
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "ch.qos.logback:logback-classic:$logbackVersion"
-}
-
-[jettyRun, jettyRunWar]*.contextPath = "/openid"
diff --git a/samples/xml/openid/spring-security-samples-xml-openid.gradle b/samples/xml/openid/spring-security-samples-xml-openid.gradle
new file mode 100644
index 0000000000..f6af367680
--- /dev/null
+++ b/samples/xml/openid/spring-security-samples-xml-openid.gradle
@@ -0,0 +1,14 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile project(':spring-security-openid')
+ compile 'org.springframework:spring-webmvc'
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ runtime project(':spring-security-config')
+ runtime project(':spring-security-taglibs')
+ runtime jstlDependencies
+ runtime slf4jDependencies
+}
diff --git a/samples/xml/preauth/preauth.gradle b/samples/xml/preauth/preauth.gradle
deleted file mode 100644
index 21935056ee..0000000000
--- a/samples/xml/preauth/preauth.gradle
+++ /dev/null
@@ -1,32 +0,0 @@
-// Preauth sample build file
-
-apply plugin: 'war'
-apply plugin: 'jetty'
-
-war.baseName = "sample"
-
-def excludeModules = ['jsr250-api', 'ehcache', 'spring-jdbc', 'spring-tx']
-
-configurations {
- excludeModules.each {name ->
- runtime.exclude module: name
- }
-
- runtime.exclude group: 'org.aspectj'
-}
-
-dependencies {
- providedCompile "javax.servlet:javax.servlet-api:3.0.1"
-
- runtime project(':spring-security-web'),
- project(':spring-security-config'),
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "ch.qos.logback:logback-classic:$logbackVersion"
-
- testCompile project(':spring-security-web'),
- project(':spring-security-config')
-}
-
-jettyRun {
- userRealms = [jettyRun.class.classLoader.loadClass('org.mortbay.jetty.security.HashUserRealm').newInstance('Preauth Realm', "$projectDir/realm.properties")]
-}
diff --git a/samples/xml/preauth/spring-security-samples-xml-preauth.gradle b/samples/xml/preauth/spring-security-samples-xml-preauth.gradle
new file mode 100644
index 0000000000..6645d9e605
--- /dev/null
+++ b/samples/xml/preauth/spring-security-samples-xml-preauth.gradle
@@ -0,0 +1,16 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ runtime project(':spring-security-config')
+ runtime project(':spring-security-web')
+ runtime slf4jDependencies
+
+ testCompile project(':spring-security-config')
+ testCompile project(':spring-security-web')
+}
+
+//jettyRun {
+// userRealms = [jettyRun.class.classLoader.loadClass('org.mortbay.jetty.security.HashUserRealm').newInstance('Preauth Realm' '$projectDir/realm.properties')]
+//}
diff --git a/samples/xml/servletapi/servletapi.gradle b/samples/xml/servletapi/servletapi.gradle
deleted file mode 100644
index e86f96ac1e..0000000000
--- a/samples/xml/servletapi/servletapi.gradle
+++ /dev/null
@@ -1,34 +0,0 @@
-// Servlet API integration sample build file
-
-apply plugin: 'war'
-
-def excludeModules = ['spring-security-acl', 'jsr250-api', 'ehcache', 'spring-jdbc', 'spring-tx']
-
-configurations {
- excludeModules.each {name ->
- runtime.exclude module: name
- }
-
- runtime.exclude group: 'org.aspectj'
-}
-
-dependencies {
- providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- compile project(':spring-security-core'),
- project(':spring-security-web'),
- "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion",
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-web:$springVersion",
- "org.springframework:spring-webmvc:$springVersion"
-
- runtime project(':spring-security-config'),
- project(':spring-security-taglibs'),
- "org.springframework:spring-context-support:$springVersion",
- jstlDependencies,
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "ch.qos.logback:logback-classic:$logbackVersion"
-}
-
-eclipse.wtp.component.contextPath = "servletapi"
diff --git a/samples/xml/servletapi/spring-security-samples-xml-servletapi.gradle b/samples/xml/servletapi/spring-security-samples-xml-servletapi.gradle
new file mode 100644
index 0000000000..e3a9e76e1d
--- /dev/null
+++ b/samples/xml/servletapi/spring-security-samples-xml-servletapi.gradle
@@ -0,0 +1,21 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile project(':spring-security-web')
+ compile 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-web'
+ compile 'org.springframework:spring-webmvc'
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ runtime project(':spring-security-config')
+ runtime project(':spring-security-taglibs')
+ runtime jstlDependencies
+ runtime slf4jDependencies
+ runtime 'org.springframework:spring-context-support'
+}
+
+eclipse.wtp.component.contextPath = 'servletapi'
diff --git a/samples/xml/tutorial/spring-security-samples-xml-tutorial.gradle b/samples/xml/tutorial/spring-security-samples-xml-tutorial.gradle
new file mode 100644
index 0000000000..8c520fdb2b
--- /dev/null
+++ b/samples/xml/tutorial/spring-security-samples-xml-tutorial.gradle
@@ -0,0 +1,16 @@
+apply plugin: 'io.spring.convention.spring-sample-war'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile slf4jDependencies
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-web'
+ compile 'org.springframework:spring-webmvc'
+
+ providedCompile 'javax.servlet:javax.servlet-api'
+
+ runtime project(':spring-security-config')
+ runtime project(':spring-security-taglibs')
+ runtime project(':spring-security-web')
+ runtime jstlDependencies
+}
diff --git a/samples/xml/tutorial/tutorial.gradle b/samples/xml/tutorial/tutorial.gradle
deleted file mode 100644
index 8f3c64db62..0000000000
--- a/samples/xml/tutorial/tutorial.gradle
+++ /dev/null
@@ -1,46 +0,0 @@
-// Tutorial sample build file
-
-apply plugin: 'war'
-apply plugin: 'jetty'
-
-war.baseName = "sample"
-
-def excludeModules = ['spring-security-acl', 'jsr250-api', 'ehcache', 'spring-jdbc', 'spring-tx']
-
-configurations {
- excludeModules.each {name ->
- runtime.exclude module: name
- }
-
- runtime.exclude group: 'org.aspectj'
-}
-
-dependencies {
- providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- compile project(':spring-security-core'),
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-web:$springVersion",
- "org.springframework:spring-webmvc:$springVersion",
- "org.slf4j:slf4j-api:$slf4jVersion"
-
- runtime project(':spring-security-web'),
- project(':spring-security-config'),
- project(':spring-security-taglibs'),
- jstlDependencies,
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "ch.qos.logback:logback-core:$logbackVersion",
- "ch.qos.logback:logback-classic:$logbackVersion"
-}
-
-jettyRun {
- def httpConnector = jettyRunWar.class.classLoader.loadClass('org.mortbay.jetty.nio.SelectChannelConnector').newInstance()
- httpConnector.port = 8080
- httpConnector.confidentialPort = 8443
- def httpsConnector = jettyRunWar.class.classLoader.loadClass('org.mortbay.jetty.security.SslSocketConnector').newInstance()
- httpsConnector.port = 8443
- httpsConnector.keystore = "$rootDir/samples/certificates/server.jks"
- httpsConnector.keyPassword = 'password'
-
- connectors = [httpConnector, httpsConnector]
-}
diff --git a/settings.gradle b/settings.gradle
index 41586c8da0..a2de87930e 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,80 +1,30 @@
rootProject.name = 'spring-security'
-rootProject.children.each {project ->
- //assert project.projectDir.isDirectory()
- //assert project.buildFile.isFile()
-}
-
-def String[] modules = [
- 'core',
- 'data',
- 'remoting',
- 'web',
- 'ldap',
- 'acl',
- 'config',
- 'cas',
- 'openid',
- 'taglibs',
- 'aspects',
- 'crypto',
- 'messaging',
- 'test'
-]
-
-include modules
-
-modules.each {name ->
- def p = findProject(":${name}")
- p.name = "spring-security-${name}"
- p.buildFileName = "${name}.gradle"
-}
-
-def String[] itest = [
- 'web',
- 'context'
-]
-
-include itest
-
-itest.each { name ->
- def p = findProject(":${name}")
- p.name = "itest-${name}"
- p.buildFileName = "itest-${name}.gradle"
- p.projectDir = new File(settingsDir, "itest/${name}");
-}
-
-include 'docs', 'docs:manual', 'docs:guides'
-
-def docs = findProject(':docs')
-docs.buildFileName = 'docs.gradle'
-
-include 'bom'
-
-findProject(':bom').name = 'spring-security-bom'
-
-includeSamples("samples" + File.separator + "xml")
-includeSamples("samples" + File.separator + "javaconfig")
-includeSamples("samples" + File.separator + "boot")
-
-void includeSamples(String samplesDir) {
- FileTree tree = fileTree(samplesDir) {
- include '**' + File.separator + '*.gradle'
+FileTree buildFiles = fileTree(rootDir) {
+ List excludes = gradle.startParameter.projectProperties.get("excludeProjects")?.split(",")
+ include '**/*.gradle'
+ exclude '**/gradle', 'settings.gradle', 'buildSrc', '/build.gradle', '.*', 'out'
+ exclude '**/grails3'
+ if(excludes) {
+ exclude excludes
}
- tree.each {File file ->
- String projectDir = file.path.substring(file.path.indexOf(samplesDir), file.path.lastIndexOf(File.separator))
- String projectPath = projectDir.substring(projectDir.lastIndexOf(File.separator) + 1)
- String projectNamePrefix = samplesDir.substring(samplesDir.lastIndexOf(File.separator) + 1).toLowerCase();
+}
+String rootDirPath = rootDir.absolutePath + File.separator
+buildFiles.each { File buildFile ->
+
+ boolean isDefaultName = 'build.gradle'.equals(buildFile.name)
+ if(isDefaultName) {
+ String buildFilePath = buildFile.parentFile.absolutePath
+ String projectPath = buildFilePath.replace(rootDirPath, '').replaceAll(File.separator, ':')
include projectPath
-
- def project = findProject(":${projectPath}")
-
- project.name = "spring-security-samples-${projectNamePrefix}-${project.name}"
- project.projectDir = new File(settingsDir, projectDir)
-
- if (!project.buildFile.exists()) {
- project.buildFileName = file.path.substring(file.path.lastIndexOf(File.separator) + 1)
- }
+ } else {
+ String projectName = buildFile.name.replace('.gradle', '');
+ String projectPath = ':' + projectName;
+ include projectPath
+ def project = findProject("${projectPath}")
+ project.name = projectName
+ project.projectDir = buildFile.parentFile
+ project.buildFileName = buildFile.name
}
}
diff --git a/taglibs/spring-security-taglibs.gradle b/taglibs/spring-security-taglibs.gradle
new file mode 100644
index 0000000000..dae6b73ae8
--- /dev/null
+++ b/taglibs/spring-security-taglibs.gradle
@@ -0,0 +1,25 @@
+apply plugin: 'io.spring.convention.spring-module'
+
+dependencies {
+ compile project(':spring-security-acl')
+ compile project(':spring-security-core')
+ compile project(':spring-security-web')
+ compile 'org.springframework:spring-aop'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-core'
+ compile 'org.springframework:spring-expression'
+ compile 'org.springframework:spring-web'
+
+ provided 'javax.servlet.jsp:javax.servlet.jsp-api'
+ provided 'javax.servlet:javax.servlet-api'
+
+ testCompile 'org.codehaus.groovy:groovy-all'
+ testCompile spockDependencies
+
+ testRuntime 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api'
+}
+
+configure(project.tasks.withType(Test)) {
+ systemProperties['springSecurityVersion'] = version
+}
diff --git a/taglibs/taglibs.gradle b/taglibs/taglibs.gradle
deleted file mode 100644
index 0b36ab17d2..0000000000
--- a/taglibs/taglibs.gradle
+++ /dev/null
@@ -1,26 +0,0 @@
-// Taglibs build file
-apply plugin: 'groovy'
-
-dependencies {
- compile project(':spring-security-core'),
- project(':spring-security-web'),
- project(':spring-security-acl'),
- springCoreDependency,
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-aop:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-expression:$springVersion",
- "org.springframework:spring-web:$springVersion"
-
- provided 'javax.servlet.jsp:javax.servlet.jsp-api:2.2.1',
- "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- testCompile "org.codehaus.groovy:groovy-all:$groovyVersion",
- spockDependencies
-
- testRuntime "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstlVersion"
-}
-
-configure(project.tasks.withType(Test)) {
- systemProperties['springSecurityVersion'] = version
-}
\ No newline at end of file
diff --git a/test/spring-security-test.gradle b/test/spring-security-test.gradle
new file mode 100644
index 0000000000..031fe0cd22
--- /dev/null
+++ b/test/spring-security-test.gradle
@@ -0,0 +1,16 @@
+apply plugin: 'io.spring.convention.spring-module'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile project(':spring-security-web')
+ compile 'org.springframework:spring-core'
+ compile 'org.springframework:spring-test'
+
+ optional project(':spring-security-config')
+
+ provided 'javax.servlet:javax.servlet-api'
+
+ testCompile 'org.springframework:spring-webmvc'
+ testCompile 'org.springframework:spring-tx'
+ testCompile powerMockDependencies
+}
diff --git a/test/test.gradle b/test/test.gradle
deleted file mode 100644
index e7e312ac30..0000000000
--- a/test/test.gradle
+++ /dev/null
@@ -1,16 +0,0 @@
-// OpenID Module build file
-
-dependencies {
- compile project(':spring-security-core'),
- project(':spring-security-web'),
- springCoreDependency,
- "org.springframework:spring-test:$springVersion"
-
- optional project(':spring-security-config')
-
- provided "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- testCompile "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-tx:$springVersion",
- powerMockDependencies
-}
diff --git a/web/spring-security-web.gradle b/web/spring-security-web.gradle
new file mode 100644
index 0000000000..7ee4bc5981
--- /dev/null
+++ b/web/spring-security-web.gradle
@@ -0,0 +1,28 @@
+apply plugin: 'io.spring.convention.spring-module'
+
+dependencies {
+ compile project(':spring-security-core')
+ compile springCoreDependency
+ compile 'aopalliance:aopalliance'
+ compile 'org.springframework:spring-beans'
+ compile 'org.springframework:spring-context'
+ compile 'org.springframework:spring-expression'
+ compile 'org.springframework:spring-web'
+
+ optional 'com.fasterxml.jackson.core:jackson-databind'
+ optional 'org.springframework:spring-jdbc'
+ optional 'org.springframework:spring-tx'
+ optional 'org.springframework:spring-webmvc'
+
+ provided 'javax.servlet:javax.servlet-api'
+
+ testCompile project(path: ':spring-security-core', configuration: 'tests')
+ testCompile 'commons-codec:commons-codec'
+ testCompile 'org.codehaus.groovy:groovy-all'
+ testCompile 'org.skyscreamer:jsonassert'
+ testCompile powerMockDependencies
+ testCompile spockDependencies
+ testCompile slf4jDependencies
+
+ testRuntime 'org.hsqldb:hsqldb'
+}
diff --git a/web/web.gradle b/web/web.gradle
deleted file mode 100644
index 12e6c68f33..0000000000
--- a/web/web.gradle
+++ /dev/null
@@ -1,28 +0,0 @@
-apply plugin: 'groovy'
-
-dependencies {
- compile project(':spring-security-core'),
- springCoreDependency,
- 'aopalliance:aopalliance:1.0',
- "org.springframework:spring-beans:$springVersion",
- "org.springframework:spring-context:$springVersion",
- "org.springframework:spring-expression:$springVersion",
- "org.springframework:spring-web:$springVersion"
-
- optional "org.springframework:spring-webmvc:$springVersion",
- "org.springframework:spring-jdbc:$springVersion",
- "org.springframework:spring-tx:$springVersion",
- "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
-
- provided "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- testCompile project(':spring-security-core').sourceSets.test.output,
- 'commons-codec:commons-codec:1.3',
- "org.slf4j:jcl-over-slf4j:$slf4jVersion",
- "org.codehaus.groovy:groovy-all:$groovyVersion",
- powerMockDependencies,
- spockDependencies,
- "org.skyscreamer:jsonassert:$jsonassertVersion"
-
- testRuntime "org.hsqldb:hsqldb:$hsqlVersion"
-}
\ No newline at end of file