add distribution and pom to jar

This commit is contained in:
aanno 2021-02-09 13:00:55 +01:00
parent b5db40cb5f
commit 240892fa83
2 changed files with 35 additions and 0 deletions

View file

@ -1,6 +1,7 @@
plugins {
`java-library`
`check-lib-versions`
`maven-publish`
}
val projectVersion: String by project
@ -32,6 +33,14 @@ configurations {
}
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
tasks.withType<Jar> {
manifest {
attributes(
@ -43,6 +52,11 @@ tasks.withType<Jar> {
"Maven-Group" to project.group
)
}
dependsOn("generatePomFileForMavenPublication")
into("META-INF/maven/${project.group}/${project.name}") {
from("$buildDir/publications/maven/pom-default.xml")
rename(".*", "pom.xml")
}
}
tasks.withType<JavaCompile> {