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 126dc30 commit ef6d1a5
Show file tree
Hide file tree
Showing 4 changed files with 21 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 @@ -9,4 +9,5 @@ repositories {

dependencies {
implementation libs.gradle.micronaut
implementation(libs.sonatype.scan)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
plugins {
id 'io.micronaut.build.internal.module'
id 'io.micronaut.build.internal.sql-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
excludeCoordinates = [
"com.h2database:h2:2.3.232" // no version patched https://ossindex.sonatype.org/component/pkg:maven/com.h2database/h2
]
}
}
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ managed-h2 = "2.3.232"
sfm-reflect = "9.0.2"
# Needed for vertx pg client and micronaut-data hibernate reactive
managed-ongres-scram = "2.1"
sonatype-scan = "2.8.3"

# Testing

Expand Down Expand Up @@ -150,6 +151,7 @@ managed-jakarta-transaction-api = { module = "jakarta.transaction:jakarta.transa

sfm-reflect = { module = "org.simpleflatmapper:sfm-reflect", version.ref = "sfm-reflect" }
managed-ongres-scram-client = { module = "com.ongres.scram:client", version.ref = "managed-ongres-scram" }
sonatype-scan = { module = "org.sonatype.gradle.plugins:scan-gradle-plugin", version.ref = "sonatype-scan" }

# Testresources

Expand Down

0 comments on commit ef6d1a5

Please sign in to comment.