diff --git a/build.gradle b/build.gradle index af5d42f2..b37a99df 100644 --- a/build.gradle +++ b/build.gradle @@ -1,389 +1,366 @@ - buildscript { - - repositories { - maven { url 'http://repo.springsource.org/plugins-release' } - } - - dependencies { - classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.1.3' - } + repositories { + maven { url "http://repo.springsource.org/plugins-release" } + } + dependencies { + classpath "org.springframework.build.gradle:docbook-reference-plugin:0.1.3" + } } configure(allprojects) { - - apply plugin: 'eclipse' - apply plugin: 'idea' - - group = 'org.springframework.webflow' + apply plugin: "eclipse" + apply plugin: "idea" + group = "org.springframework.webflow" } configure(subprojects) { subproject -> + apply plugin: "java" + apply from: "${rootProject.projectDir}/publish-maven.gradle" - apply plugin: 'java' - apply from: "${rootProject.projectDir}/publish-maven.gradle" + sourceCompatibility=1.5 + targetCompatibility=1.5 - sourceCompatibility=1.5 - targetCompatibility=1.5 + [compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:none"] - [compileJava, compileTestJava]*.options*.compilerArgs = ['-Xlint:none'] + sourceSets.test.resources.srcDirs = ["src/main/java", "src/test/resources", "src/test/java"] - sourceSets.test.resources.srcDirs = ['src/main/java', 'src/test/resources', 'src/test/java'] + repositories { + maven { url "http://repo.springsource.org/libs-release" } + } - repositories { - maven { url "http://repo.springsource.org/libs-release" } - } + jar { + manifest.attributes["Implementation-Title"] = subproject.name + manifest.attributes["Implementation-Version"] = subproject.version - jar { - manifest.attributes['Implementation-Title'] = subproject.name - manifest.attributes['Implementation-Version'] = subproject.version - - from("${rootProject.projectDir}/src/dist") { - include "license.txt" - include "notice.txt" - into "META-INF" - expand(copyright: new Date().format('yyyy'), version: project.version) - } - } + from("${rootProject.projectDir}/src/dist") { + include "license.txt" + include "notice.txt" + into "META-INF" + expand(copyright: new Date().format("yyyy"), version: project.version) + } + } } -configure(subprojects.findAll {it.name != 'spring-js-resources'}) { subproject -> +configure(subprojects.findAll {it.name != "spring-js-resources"}) { subproject -> + dependencies { + testCompile("junit:junit-dep:4.10") + testCompile("org.hamcrest:hamcrest-all:1.3") + testCompile("org.easymock:easymock:3.1") + } - dependencies { - testCompile "junit:junit-dep:4.10" - testCompile "org.hamcrest:hamcrest-all:1.3" - testCompile "org.easymock:easymock:3.1" - } + subproject.ext { + springVersion = "3.2.1.RELEASE" + springSecurityVersion = "3.1.3.RELEASE" + slf4jVersion = "1.6.1" + log4jVersion = "1.2.15" + } - subproject.ext { - springVersion = '3.2.1.RELEASE' - springSecurityVersion = '3.1.3.RELEASE' - slf4jVersion = '1.6.1' - log4jVersion = '1.2.15' - } + test { + systemProperty("java.awt.headless", "true") + include "**/*Tests.class" + } - test { - systemProperty("java.awt.headless", "true") - include '**/*Tests.class' - } + javadoc { + options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED + options.author = true + options.header = project.name + } - javadoc { - options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED - options.author = true - options.header = project.name - } + task sourcesJar(type: Jar, dependsOn:classes) { + classifier = "sources" + from sourceSets.main.allJava + } - task sourcesJar(type: Jar, dependsOn:classes) { - classifier = 'sources' - from sourceSets.main.allJava - } + task javadocJar(type: Jar) { + classifier = "javadoc" + from javadoc + } - task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc - } - - artifacts { - archives sourcesJar - archives javadocJar - } + artifacts { + archives sourcesJar + archives javadocJar + } } -project('spring-binding') { +project("spring-binding") { + description = "Spring Binding" - description = 'Spring Binding' - - dependencies { - - compile("javax.el:el-api:2.2", provided) - compile "commons-logging:commons-logging:1.1.1" - compile "opensymphony:ognl:2.6.11" - compile "org.springframework:spring-beans:$springVersion" - compile "org.springframework:spring-context:$springVersion" - compile "org.springframework:spring-core:$springVersion" - compile "org.springframework:spring-expression:$springVersion" - - testCompile("log4j:log4j:$log4jVersion") { dep -> - optional dep - exclude group: 'javax.mail', module: 'mail' - exclude group: 'javax.jms', module: 'jms' - exclude group: 'com.sun.jdmk', module: 'jmxtools' - exclude group: 'com.sun.jmx', module: 'jmxri' - } - testCompile("org.apache.tomcat:tomcat-jasper-el:7.0.27") - } + dependencies { + compile("javax.el:el-api:2.2", provided) + compile("commons-logging:commons-logging:1.1.1") + compile("opensymphony:ognl:2.6.11") + compile("org.springframework:spring-beans:$springVersion") + compile("org.springframework:spring-context:$springVersion") + compile("org.springframework:spring-core:$springVersion") + compile("org.springframework:spring-expression:$springVersion") + testCompile("log4j:log4j:$log4jVersion") { dep -> + optional dep + exclude group: "javax.mail", module: "mail" + exclude group: "javax.jms", module: "jms" + exclude group: "com.sun.jdmk", module: "jmxtools" + exclude group: "com.sun.jmx", module: "jmxri" + } + testCompile("org.apache.tomcat:tomcat-jasper-el:7.0.27") + } } -project('spring-js-resources') { +project("spring-js-resources") { + description = "Spring JS Resources" - description = 'Spring JS Resources' + apply from: "spring-js-resources.gradle" - apply from: "spring-js-resources.gradle" - - jar { - dependsOn prepareResources - } + jar { + dependsOn prepareResources + } } -project('spring-js') { +project("spring-js") { + description = "Spring JS" - description = 'Spring JS' - - dependencies { - - compile project(":spring-js-resources") - - compile "commons-logging:commons-logging:1.1.1" - compile("javax.servlet:servlet-api:2.5", provided) - compile("org.apache.tiles:tiles-api:2.1.2", optional) - compile("org.apache.tiles:tiles-core:2.1.2", optional) - compile("org.apache.tiles:tiles-jsp:2.1.2", optional) - compile("org.apache.tiles:tiles-servlet:2.1.2", optional) - compile "org.springframework:spring-beans:$springVersion" - compile "org.springframework:spring-context:$springVersion" - compile "org.springframework:spring-core:$springVersion" - compile "org.springframework:spring-web:$springVersion" - compile "org.springframework:spring-webmvc:$springVersion" - - testCompile("javax.servlet:jstl:1.2", provided) - testCompile("log4j:log4j:$log4jVersion") { dep -> - optional dep - exclude group: 'javax.mail', module: 'mail' - exclude group: 'javax.jms', module: 'jms' - exclude group: 'com.sun.jdmk', module: 'jmxtools' - exclude group: 'com.sun.jmx', module: 'jmxri' - } - testCompile "org.springframework:spring-test:$springVersion" - } + dependencies { + compile(project(":spring-js-resources")) + compile("commons-logging:commons-logging:1.1.1") + compile("javax.servlet:servlet-api:2.5", provided) + compile("org.apache.tiles:tiles-api:2.1.2", optional) + compile("org.apache.tiles:tiles-core:2.1.2", optional) + compile("org.apache.tiles:tiles-jsp:2.1.2", optional) + compile("org.apache.tiles:tiles-servlet:2.1.2", optional) + compile("org.springframework:spring-beans:$springVersion") + compile("org.springframework:spring-context:$springVersion") + compile("org.springframework:spring-core:$springVersion") + compile("org.springframework:spring-web:$springVersion") + compile("org.springframework:spring-webmvc:$springVersion") + testCompile("javax.servlet:jstl:1.2", provided) + testCompile("log4j:log4j:$log4jVersion") { dep -> + optional dep + exclude group: "javax.mail", module: "mail" + exclude group: "javax.jms", module: "jms" + exclude group: "com.sun.jdmk", module: "jmxtools" + exclude group: "com.sun.jmx", module: "jmxri" + } + testCompile("org.springframework:spring-test:$springVersion") + } } -project('spring-webflow') { +project("spring-webflow") { + description = "Spring Web Flow" - description = 'Spring Web Flow' - - dependencies { - - compile project(":spring-binding") - compile project(":spring-js") - - compile "commons-logging:commons-logging:1.1.1" - compile("javax.el:el-api:2.2", provided) - compile("javax.persistence:persistence-api:1.0.2", provided) - compile("javax.servlet:servlet-api:2.5", provided) - compile("javax.portlet:portlet-api:2.0", provided) - compile("javax.transaction:transaction-api:1.1-rev-1", provided) - compile("junit:junit:3.8.2", provided) - compile "opensymphony:ognl:2.6.11" - compile("org.hibernate:hibernate:3.2.7.ga") { dep -> - optional dep - exclude group: 'org.slf4j', module: 'slf4j-api' - } - compile("org.slf4j:slf4j-api:$slf4jVersion", optional) - compile "org.springframework:spring-beans:$springVersion" - compile "org.springframework:spring-context:$springVersion" - compile "org.springframework:spring-core:$springVersion" - compile "org.springframework:spring-expression:$springVersion" - compile("org.springframework:spring-orm:$springVersion", optional) - compile("org.springframework:spring-tx:$springVersion", optional) - compile "org.springframework:spring-web:$springVersion" - compile "org.springframework:spring-webmvc:$springVersion" - compile("org.springframework:spring-webmvc-portlet:$springVersion", optional) - compile("org.springframework.security:spring-security-core:$springSecurityVersion", optional) - - testCompile "javax.validation:validation-api:1.0.0.GA" - testCompile "org.apache.openjpa:openjpa:1.1.0" - testCompile "org.apache.openjpa:openjpa-lib:1.1.0" - testCompile "org.apache.openjpa:openjpa-persistence:1.1.0" - testCompile "org.apache.openjpa:openjpa-persistence-jdbc:1.1.0" - testCompile "org.apache.tomcat:tomcat-jasper-el:7.0.27" - testCompile "org.hsqldb:hsqldb:2.2.8" - testCompile "org.springframework:spring-aop:$springVersion" - testCompile "org.springframework:spring-jdbc:$springVersion" - testCompile "org.springframework:spring-test:$springVersion" - } + dependencies { + compile(project(":spring-binding")) + compile(project(":spring-js")) + compile("commons-logging:commons-logging:1.1.1") + compile("javax.el:el-api:2.2", provided) + compile("javax.persistence:persistence-api:1.0.2", provided) + compile("javax.servlet:servlet-api:2.5", provided) + compile("javax.portlet:portlet-api:2.0", provided) + compile("javax.transaction:transaction-api:1.1-rev-1", provided) + compile("junit:junit:3.8.2", provided) + compile("opensymphony:ognl:2.6.11") + compile("org.hibernate:hibernate:3.2.7.ga") { dep -> + optional dep + exclude group: "org.slf4j", module: "slf4j-api" + } + compile("org.slf4j:slf4j-api:$slf4jVersion", optional) + compile("org.springframework:spring-beans:$springVersion") + compile("org.springframework:spring-context:$springVersion") + compile("org.springframework:spring-core:$springVersion") + compile("org.springframework:spring-expression:$springVersion") + compile("org.springframework:spring-orm:$springVersion", optional) + compile("org.springframework:spring-tx:$springVersion", optional) + compile("org.springframework:spring-web:$springVersion") + compile("org.springframework:spring-webmvc:$springVersion") + compile("org.springframework:spring-webmvc-portlet:$springVersion", optional) + compile("org.springframework.security:spring-security-core:$springSecurityVersion", optional) + testCompile("javax.validation:validation-api:1.0.0.GA") + testCompile("org.apache.openjpa:openjpa:1.1.0") + testCompile("org.apache.openjpa:openjpa-lib:1.1.0") + testCompile("org.apache.openjpa:openjpa-persistence:1.1.0") + testCompile("org.apache.openjpa:openjpa-persistence-jdbc:1.1.0") + testCompile("org.apache.tomcat:tomcat-jasper-el:7.0.27") + testCompile("org.hsqldb:hsqldb:2.2.8") + testCompile("org.springframework:spring-aop:$springVersion") + testCompile("org.springframework:spring-jdbc:$springVersion") + testCompile("org.springframework:spring-test:$springVersion") + } } -project('spring-faces') { +project("spring-faces") { + description = "Spring Faces" - description = 'Spring Faces' - - dependencies { - compile project(":spring-binding") - compile project(":spring-webflow") - - compile "commons-logging:commons-logging:1.1.1" - compile("javax.servlet:servlet-api:2.5", provided) - compile("javax.portlet:portlet-api:2.0", provided) - compile "org.springframework:spring-beans:$springVersion" - compile "org.springframework:spring-context:$springVersion" - compile "org.springframework:spring-core:$springVersion" - compile "org.springframework:spring-expression:$springVersion" - compile "org.springframework:spring-web:$springVersion" - compile "org.springframework:spring-webmvc:$springVersion" - compile("org.springframework.security:spring-security-core:$springSecurityVersion", optional) - compile("org.springframework.security:spring-security-web:$springSecurityVersion", optional) - compile("com.sun.facelets:jsf-facelets:1.1.14", optional) - compile("com.sun.faces:jsf-api:2.1.7", provided) - compile("com.sun.faces:jsf-impl:2.1.7", provided) - compile("org.apache.myfaces.core:myfaces-impl:2.1.7", provided) - - testCompile("log4j:log4j:$log4jVersion") { dep -> - optional dep - exclude group: 'javax.mail', module: 'mail' - exclude group: 'javax.jms', module: 'jms' - exclude group: 'com.sun.jdmk', module: 'jmxtools' - exclude group: 'com.sun.jmx', module: 'jmxri' - } - testCompile "org.apache.myfaces.test:myfaces-test20:1.0.4" - testCompile "org.apache.tomcat:tomcat-jasper-el:7.0.27" - testCompile "org.slf4j:jcl-over-slf4j:$slf4jVersion" - testCompile("org.slf4j:slf4j-log4j12:$slf4jVersion") { - exclude group: 'log4j', module: 'log4j' - } - testCompile "org.springframework:spring-test:$springVersion" - } + dependencies { + compile(project(":spring-binding")) + compile(project(":spring-webflow")) + compile("commons-logging:commons-logging:1.1.1") + compile("javax.servlet:servlet-api:2.5", provided) + compile("javax.portlet:portlet-api:2.0", provided) + compile("org.springframework:spring-beans:$springVersion") + compile("org.springframework:spring-context:$springVersion") + compile("org.springframework:spring-core:$springVersion") + compile("org.springframework:spring-expression:$springVersion") + compile("org.springframework:spring-web:$springVersion") + compile("org.springframework:spring-webmvc:$springVersion") + compile("org.springframework.security:spring-security-core:$springSecurityVersion", optional) + compile("org.springframework.security:spring-security-web:$springSecurityVersion", optional) + compile("com.sun.facelets:jsf-facelets:1.1.14", optional) + compile("com.sun.faces:jsf-api:2.1.7", provided) + compile("com.sun.faces:jsf-impl:2.1.7", provided) + compile("org.apache.myfaces.core:myfaces-impl:2.1.7", provided) + testCompile("log4j:log4j:$log4jVersion") { dep -> + optional dep + exclude group: "javax.mail", module: "mail" + exclude group: "javax.jms", module: "jms" + exclude group: "com.sun.jdmk", module: "jmxtools" + exclude group: "com.sun.jmx", module: "jmxri" + } + testCompile("org.apache.myfaces.test:myfaces-test20:1.0.4") + testCompile("org.apache.tomcat:tomcat-jasper-el:7.0.27") + testCompile("org.slf4j:jcl-over-slf4j:$slf4jVersion") + testCompile("org.slf4j:slf4j-log4j12:$slf4jVersion") { + exclude group: "log4j", module: "log4j" + } + testCompile("org.springframework:spring-test:$springVersion") + } } configure(rootProject) { + description = "Spring Web Flow" - description = 'Spring Web Flow' + apply plugin: "docbook-reference" - apply plugin: 'docbook-reference' + reference { + sourceDir = file("src/reference") + } - reference { - sourceDir = file('src/reference') - } + // don"t publish the default jar for the root project + configurations.archives.artifacts.clear() - // don't publish the default jar for the root project - configurations.archives.artifacts.clear() + artifacts { + } - artifacts { - } + task api(type: Javadoc) { + group = "Documentation" + description = "Generates aggregated Javadoc API documentation." + title = "${rootProject.description} ${version} API" + options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED + options.author = true + options.header = rootProject.description + options.overview = "src/api/overview.html" + source subprojects.collect { project -> + project.sourceSets.main.allJava + } + destinationDir = new File(buildDir, "api") + classpath = files(subprojects.collect { project -> + project.sourceSets.main.compileClasspath + }) + maxMemory = "1024m" + } - task api(type: Javadoc) { - group = 'Documentation' - description = 'Generates aggregated Javadoc API documentation.' - title = "${rootProject.description} ${version} API" - options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED - options.author = true - options.header = rootProject.description - options.overview = 'src/api/overview.html' - source subprojects.collect { project -> - project.sourceSets.main.allJava - } - destinationDir = new File(buildDir, "api") - classpath = files(subprojects.collect { project -> - project.sourceSets.main.compileClasspath - }) - maxMemory = '1024m' - } + task docsZip(type: Zip) { + group = "Distribution" + classifier = "docs" + description = "Builds -${classifier} archive containing api and reference " + + "for deployment at static.springframework.org/spring-webflow/docs." - task docsZip(type: Zip) { - group = 'Distribution' - classifier = 'docs' - description = "Builds -${classifier} archive containing api and reference " + - "for deployment at static.springframework.org/spring-webflow/docs." + from("src/dist") { + include "changelog.txt" + } - from('src/dist') { - include 'changelog.txt' - } + from (api) { + into "api" + } - from (api) { - into 'api' - } + from (reference) { + into "reference" + } + } - from (reference) { - into 'reference' - } - } + task schemaZip(type: Zip) { + group = "Distribution" + classifier = "schema" + description = "Builds -${classifier} archive containing all " + + "XSDs for deployment at static.springframework.org/schema." - task schemaZip(type: Zip) { - group = 'Distribution' - classifier = 'schema' - description = "Builds -${classifier} archive containing all " + - "XSDs for deployment at static.springframework.org/schema." + subprojects.each { subproject -> + def Properties schemas = new Properties(); - subprojects.each { subproject -> - def Properties schemas = new Properties(); + subproject.sourceSets.main.resources.find { + it.path.endsWith("META-INF/spring.schemas") + }?.withInputStream { schemas.load(it) } - subproject.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 = subproject.sourceSets.main.allSource.find { + it.path.endsWith(schemas.get(key)) + } + assert xsdFile != null + into (shortName) { + from xsdFile.path + } + } + } + } - for (def key : schemas.keySet()) { - def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1') - assert shortName != key - File xsdFile = subproject.sourceSets.main.allSource.find { - it.path.endsWith(schemas.get(key)) - } - assert xsdFile != null - into (shortName) { - from xsdFile.path - } - } - } - } + task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) { + group = "Distribution" + classifier = "dist" + description = "Builds -${classifier} archive, containing all jars and docs, " + + "suitable for community download page." - task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) { - group = 'Distribution' - classifier = 'dist' - description = "Builds -${classifier} archive, containing all jars and docs, " + - "suitable for community download page." + def baseDir = "${project.name}-${project.version}"; - def baseDir = "${project.name}-${project.version}"; + from("src/dist") { + include "notice.txt" + into "${baseDir}" + expand(copyright: new Date().format("yyyy"), version: project.version) + } - from('src/dist') { - include 'notice.txt' - into "${baseDir}" - expand(copyright: new Date().format('yyyy'), version: project.version) - } + from("src/dist") { + include "readme.txt" + include "license.txt" + into "${baseDir}" + } - from('src/dist') { - include 'readme.txt' - include 'license.txt' - into "${baseDir}" - } + from(zipTree(docsZip.archivePath)) { + into "${baseDir}/docs" + } - from(zipTree(docsZip.archivePath)) { - into "${baseDir}/docs" - } + from(zipTree(schemaZip.archivePath)) { + into "${baseDir}/schema" + } - from(zipTree(schemaZip.archivePath)) { - into "${baseDir}/schema" - } + subprojects.each { subproject -> + into ("${baseDir}/libs") { + from subproject.jar + if (subproject.tasks.findByPath("sourcesJar")) { + from subproject.sourcesJar + } + if (subproject.tasks.findByPath("javadocJar")) { + from subproject.javadocJar + } + } + } + } - subprojects.each { subproject -> - into ("${baseDir}/libs") { - from subproject.jar - if (subproject.tasks.findByPath('sourcesJar')) { - from subproject.sourcesJar - } - if (subproject.tasks.findByPath('javadocJar')) { - from subproject.javadocJar - } - } - } - } + artifacts { + archives docsZip + archives schemaZip + archives distZip + } - artifacts { - archives docsZip - archives schemaZip - archives distZip - } + task wrapper(type: Wrapper) { + description = "Generates gradlew[.bat] scripts" + gradleVersion = "1.3" - task wrapper(type: Wrapper) { - description = 'Generates gradlew[.bat] scripts' - gradleVersion = '1.3' - - doLast() { - def gradleOpts = "-XX:MaxPermSize=1024m -Xmx1024m" - def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m" - File wrapperFile = file('gradlew') - wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=", - "GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=") - File wrapperBatFile = file('gradlew.bat') - wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=", - "set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=") - } - } + doLast() { + def gradleOpts = "-XX:MaxPermSize=1024m -Xmx1024m" + def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m" + File wrapperFile = file("gradlew") + wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=", + "GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=") + File wrapperBatFile = file("gradlew.bat") + wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=", + "set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=") + } + } } diff --git a/publish-maven.gradle b/publish-maven.gradle index 8baaebb4..0ec323e4 100644 --- a/publish-maven.gradle +++ b/publish-maven.gradle @@ -1,4 +1,4 @@ -apply plugin: 'maven' +apply plugin: "maven" ext.optionalDeps = [] ext.providedDeps = [] @@ -7,59 +7,59 @@ ext.optional = { optionalDeps << it } ext.provided = { providedDeps << it } install { - repositories.mavenInstaller { - customizePom(pom, project) - } + repositories.mavenInstaller { + customizePom(pom, project) + } } def customizePom(pom, gradleProject) { - pom.whenConfigured { generatedPom -> - // respect 'optional' and 'provided' dependencies - gradleProject.optionalDeps.each { dep -> - generatedPom.dependencies.find { it.artifactId == dep.name }?.optional = true - } - gradleProject.providedDeps.each { dep -> - generatedPom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided' - } + pom.whenConfigured { generatedPom -> + // respect "optional" and "provided" dependencies + gradleProject.optionalDeps.each { dep -> + generatedPom.dependencies.find { it.artifactId == dep.name }?.optional = true + } + gradleProject.providedDeps.each { dep -> + generatedPom.dependencies.find { it.artifactId == dep.name }?.scope = "provided" + } - // eliminate test-scoped dependencies (no need in maven central poms) - generatedPom.dependencies.removeAll { dep -> - dep.scope == 'test' - } + // eliminate test-scoped dependencies (no need in maven central poms) + generatedPom.dependencies.removeAll { dep -> + dep.scope == "test" + } - // add all items necessary for maven central publication - generatedPom.project { - name = gradleProject.description - description = gradleProject.description - url = 'https://github.com/SpringSource/spring-webflow' - organization { - name = 'SpringSource' - url = 'http://springsource.org/spring-webflow' - } - 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/SpringSource/spring-webflow' - connection = 'scm:git:git://github.com/SpringSource/spring-webflow' - developerConnection = 'scm:git:git://github.com/SpringSource/spring-webflow' - } - developers { - developer { - id = 'rstoyanchev' - name = 'Rossen Stoyanchev' - email = 'rstoyanchev@vmware.com' - } - developer { - id = 'pwebb' - name = 'Phil Webb' - email = 'pwebb@vmware.com' - } - } - } - } + // add all items necessary for maven central publication + generatedPom.project { + name = gradleProject.description + description = gradleProject.description + url = "https://github.com/SpringSource/spring-webflow" + organization { + name = "SpringSource" + url = "http://springsource.org/spring-webflow" + } + 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/SpringSource/spring-webflow" + connection = "scm:git:git://github.com/SpringSource/spring-webflow" + developerConnection = "scm:git:git://github.com/SpringSource/spring-webflow" + } + developers { + developer { + id = "rstoyanchev" + name = "Rossen Stoyanchev" + email = "rstoyanchev@vmware.com" + } + developer { + id = "pwebb" + name = "Phil Webb" + email = "pwebb@vmware.com" + } + } + } + } }