apply plugin: "maven"

install {
	repositories.mavenInstaller {
		customizePom(pom, project)
	}
}

def customizePom(pom, gradleProject) {
	pom.whenConfigured { generatedPom ->
		// sort to make pom dependencies order consistent to ease comparison of older poms
		generatedPom.dependencies = generatedPom.dependencies.sort { dep ->
			"$dep.scope:$dep.groupId:$dep.artifactId"
		}
		generatedPom.dependencies.clear();

		// add all items necessary for maven central publication
		generatedPom.project {
			name = "Springloaded"//gradleProject.description
			description = "JVM reloading agent"//gradleProject.description
			url = "https://github.com/spring-projects/spring-loaded"
			organization {
				name = "Spring IO"
				url = "http://projects.spring.io/spring-loaded"
			}
			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-loaded"
				connection = "scm:git:git://github.com/spring-projects/spring-loaded"
				developerConnection = "scm:git:git://github.com/spring-projects/spring-loaded"
			}
			developers {
				developer {
					id = "aclement"
					name = "Andy Clement"
					email = "aclement@gopivotal.com"
				}
			}
			issueManagement {
				system = "GitHub"
				url = "https://github.com/spring-projects/spring-loaded/issues"
			}
		}
	}
}
