Skip to content

Commit fb816a0

Browse files
authored
Sonatype Scan Gradle Plugin (#120)
1 parent 350b8b6 commit fb816a0

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

buildSrc/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
plugins {
22
id 'groovy-gradle-plugin'
33
}
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
implementation(libs.sonatype.scan)
11+
}

buildSrc/settings.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dependencyResolutionManagement {
2+
versionCatalogs {
3+
libs {
4+
from(files("../gradle/libs.versions.toml"))
5+
}
6+
}
7+
}
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
plugins {
22
id 'io.micronaut.build.internal.json-schema-base'
33
id "io.micronaut.build.internal.module"
4+
id("org.sonatype.gradle.plugins.scan")
45
}
5-
66
micronautBuild {
77
binaryCompatibility {
88
enabled.set(false)
99
}
1010
}
11+
String ossIndexUsername = System.getenv("OSS_INDEX_USERNAME") ?: project.properties["ossIndexUsername"]
12+
String ossIndexPassword = System.getenv("OSS_INDEX_PASSWORD") ?: project.properties["ossIndexPassword"]
13+
boolean sonatypePluginConfigured = ossIndexUsername != null && ossIndexPassword != null
14+
if (sonatypePluginConfigured) {
15+
ossIndexAudit {
16+
username = ossIndexUsername
17+
password = ossIndexPassword
18+
}
19+
}

gradle/libs.versions.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ kotlin = "1.9.25"
3030
ksp = "1.9.25-1.0.20"
3131
spock = "2.3-groovy-4.0"
3232
java-parser = "3.26.3"
33+
sonatype-scan = "3.0.0"
3334

3435
[libraries]
3536
micronaut-core = { module = 'io.micronaut:micronaut-core-bom', version.ref = 'micronaut' }
@@ -47,6 +48,8 @@ java-parser = { module = "com.github.javaparser:javaparser-core", version.ref =
4748
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api" }
4849
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" }
4950
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params" }
51+
sonatype-scan = { module = "org.sonatype.gradle.plugins:scan-gradle-plugin", version.ref = "sonatype-scan" }
52+
5053
[bundles]
5154

5255
[plugins]

0 commit comments

Comments
 (0)