diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/tracelog/build/TraceLogBuildExtensionImpl.kt b/build-logic/src/main/kotlin/dev/msfjarvis/tracelog/build/TraceLogBuildExtensionImpl.kt index 343e615..a509fbd 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/tracelog/build/TraceLogBuildExtensionImpl.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/tracelog/build/TraceLogBuildExtensionImpl.kt @@ -31,10 +31,14 @@ class TraceLogBuildExtensionImpl( maven { name = "Sonatype" setUrl { - val repositoryId = - System.getenv("SONATYPE_REPOSITORY_ID") - ?: error("Missing env variable: SONATYPE_REPOSITORY_ID") - "https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${repositoryId}/" + if (project.findProperty("VERSION_NAME").toString().endsWith("-SNAPSHOT")) { + "https://oss.sonatype.org/content/repositories/snapshots/" + } else { + val repositoryId = + System.getenv("SONATYPE_REPOSITORY_ID") + ?: error("Missing env variable: SONATYPE_REPOSITORY_ID") + "https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${repositoryId}/" + } } credentials { username = System.getenv("SONATYPE_USERNAME")