1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- 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'
- }
- }
- }
- }
- 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
|