Skip to content

Commit ad1b97b

Browse files
authored
Merge pull request #35 from modelix/feature/modelix-961
build: set apache license in mvn artifacts
2 parents 9645b18 + 90b75a2 commit ad1b97b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

build.gradle.kts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,29 @@ allprojects {
4141
}
4242
}
4343
}
44+
45+
// Set maven metadata for all known publishing tasks. The exact tasks and names are only known after evaluation.
46+
afterEvaluate {
47+
tasks.withType<AbstractPublishToMaven>() {
48+
this.publication?.apply {
49+
setMetadata()
50+
}
51+
}
52+
}
53+
}
54+
55+
fun MavenPublication.setMetadata() {
56+
pom {
57+
url.set("https://github.com/modelix/modelix.incremental")
58+
scm {
59+
connection.set("scm:git:https://github.com/modelix/modelix.incremental.git")
60+
url.set("https://github.com/modelix/modelix.incremental")
61+
}
62+
licenses {
63+
license {
64+
name.set("The Apache License, Version 2.0")
65+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
66+
}
67+
}
68+
}
4469
}

0 commit comments

Comments
 (0)