Skip to content

Commit

Permalink
Change bom deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMeinerLP committed May 28, 2024
1 parent f418602 commit 37576d2
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions bom/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import java.net.URI

plugins {
id("io.github.gradlebom.generator-plugin") version "1.0.0.Final"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
`java-platform`
`maven-publish`
signing
}

Expand All @@ -11,11 +13,11 @@ repositories {
mavenCentral()
maven(url = "https://jitpack.io")
}

bomGenerator {
val version = rootProject.version as String
includeDependency("net.onelitefeather.microtus", "Microtus", version)
includeDependency("net.onelitefeather.microtus.testing", "testing", version)
dependencies {
constraints {
api(project(":testing"))
api(rootProject)
}
}

signing {
Expand All @@ -29,8 +31,23 @@ signing {
}
publishing {
publications {
create<MavenPublication>("maven") {
repositories {
maven {
name = "sonatype"
url = uri(if (version.toString().endsWith("SNAPSHOT")) {
"https://s01.oss.sonatype.org/content/repositories/snapshots/"
} else {
"https://s01.oss.sonatype.org/service/local/"
})

credentials {
username = project.findProperty("sonatypeUsername") as String? ?: ""
password = project.findProperty("sonatypePassword") as String? ?: ""
}
}
}
create<MavenPublication>("maven") {
from(components["javaPlatform"])
pom {
name.set(project.name)
description.set("Bill of materials for Microtus projects.")
Expand Down Expand Up @@ -69,4 +86,4 @@ publishing {
}
}
}
}
}

0 comments on commit 37576d2

Please sign in to comment.