12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- 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
- archives javadocJar
- }
- // Configuration for SpringSource s3 maven deployer
- configurations {
- deployerJars
- }
- dependencies {
- deployerJars "org.springframework.build.aws:org.springframework.build.aws.maven:3.0.0.RELEASE"
- }
- install {
- customizePom(repositories.mavenInstaller.pom, project)
- }
- def customizePom(pom, gradleProject) {
- pom.whenConfigured { p ->
- p.dependencies.findAll{ it.scope == "optional" }.each {
- it.scope = "compile"
- it.optional = true
- }
- // 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"
- }
- }
- pom.project {
- name = gradleProject.name
- description = gradleProject.name
- url = 'http://springsource.org/spring-security'
- organization {
- name = 'SpringSource'
- url = 'http://springsource.org/'
- }
- 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-security'
- connection = 'scm:git:git://github.com/SpringSource/spring-security'
- developerConnection = 'scm:git:git://github.com/SpringSource/spring-security'
- }
- developers {
- developer {
- id = 'rwinch'
- name = 'Rob Winch'
- email = 'rwinch@vmware.com'
- }
- }
- dependencies {
- dependency {
- artifactId = groupId = 'commons-logging'
- scope = 'compile'
- optional = 'true'
- version = '1.1.1'
- }
- }
- }
- }
- 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
|