Skip to content

Commit

Permalink
Sonatype Scan Gradle Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
sdelamo committed Dec 23, 2024
1 parent e449aad commit a228442
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
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 @@ -10,4 +10,5 @@ repositories {
dependencies {
implementation(libs.gradle.graal)
implementation(libs.gradle.kotlin)
implementation(libs.sonatype.scan)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
plugins {
id 'io.micronaut.build.internal.module'
id 'io.micronaut.build.internal.cache-base'
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
excludeCompileOnly = true
}
}

4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ micronaut-test-resources = "2.7.0"
micronaut-validation = "4.8.0"
graal-svm = "23.1.5"
graal-plugin = "0.10.4"
micronaut-logging = "1.5.1"
sonatype-scan = "2.8.3"

micronaut-logging = "1.4.0"
[libraries]
# Core
micronaut-core = { module = 'io.micronaut:micronaut-core-bom', version.ref = 'micronaut' }
Expand All @@ -47,5 +48,6 @@ testcontainers-junit = { module = "org.testcontainers:junit-jupiter" }
testcontainers-spock = { module = "org.testcontainers:spock" }
graal-svm = { module = "org.graalvm.nativeimage:svm", version.ref = "graal-svm" }
spock-core = { module = "org.spockframework:spock-core", version.ref = "spock" }
sonatype-scan = { module = "org.sonatype.gradle.plugins:scan-gradle-plugin", version.ref = "sonatype-scan" }
gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
gradle-graal = { module = "org.graalvm.buildtools.native:org.graalvm.buildtools.native.gradle.plugin", version.ref = "graal-plugin" }

0 comments on commit a228442

Please sign in to comment.