Skip to content

Commit

Permalink
build: Sonatype Scan Gradle Plugin (#11465)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdelamo authored Dec 23, 2024
1 parent 291b070 commit 2b40d35
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ jobs:
run: |
[ -f ./setup.sh ] && ./setup.sh || [ ! -f ./setup.sh ]
- name: "🚔 Sonatype Scan"
id: sonatypescan
run: |
./gradlew ossIndexAudit --no-parallel
- name: "🛠 Build with Gradle"
id: gradle
run: |
Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ dependencies {
implementation libs.tomlj
implementation libs.japicmp.gradle.plugin
implementation libs.native.gradle.plugin
implementation(libs.sonatype.scan)
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
plugins {
id "io.micronaut.build.internal.convention-library"
id("org.sonatype.gradle.plugins.scan")
}
String ossIndexUsername = System.getenv("OSS_INDEX_USERNAME") ?: project.properties["ossIndexUsername"]
String ossIndexPassword = System.getenv("OSS_INDEX_PASSWORD") ?: project.properties["ossIndexPassword"]
boolean sonatypePluginConfigured = ossIndexUsername != null && ossIndexPassword != null
if (sonatypePluginConfigured) {
ossIndexAudit {
username = ossIndexUsername
password = ossIndexPassword
}
}

2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ managed-reactor = "3.6.10"
managed-snakeyaml = "2.2"
managed-java-parser-core = "3.26.3"
managed-ksp = "1.9.25-1.0.20"
sonatype-scan = "2.8.3"
micronaut-docs = "2.0.0"

[libraries]
Expand Down Expand Up @@ -164,6 +165,7 @@ managed-reactor-test = { module = "io.projectreactor:reactor-test", version.ref

managed-snakeyaml = { module = "org.yaml:snakeyaml", version.ref = "managed-snakeyaml" }

sonatype-scan = { module = "org.sonatype.gradle.plugins:scan-gradle-plugin", version.ref = "sonatype-scan" }
#
# Other libraries are used by Micronaut but will not appear in the BOM
#
Expand Down

0 comments on commit 2b40d35

Please sign in to comment.