Skip to content

Commit f58c2a6

Browse files
committed
simplify config
1 parent 65c7455 commit f58c2a6

5 files changed

Lines changed: 6 additions & 26 deletions

File tree

.github/workflows/oss-index-audit-daily.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@ jobs:
2424
- name: Set up gradle
2525
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
2626

27-
# --max-workers=1: scan-gradle-plugin is not thread-safe when tasks run in parallel.
28-
# Each ossIndexAudit task calls project.getAllprojects() and resolves configurations
29-
# at execution time; concurrent tasks racing on the same configurations cause
30-
# intermittent NullPointerExceptions. Running serially avoids this.
31-
- run: ./gradlew ossIndexAudit --max-workers=1
27+
# --no-parallel is needed to avoid OverlappingFileLockException on the shared OSS Index cache
28+
- run: ./gradlew ossIndexAudit --no-configuration-cache --no-parallel --info
3229
id: audit
3330
continue-on-error: true
3431
env:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ bin
3434

3535
# Vim
3636
.swp
37+
38+
# scan-gradle-plugin
39+
oss-index-cyclonedx-bom.json

buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,7 @@ ossIndexAudit {
5252
username = System.getenv("SONATYPE_OSS_INDEX_USER") ?: ""
5353
password = System.getenv("SONATYPE_OSS_INDEX_PASSWORD") ?: ""
5454
outputFormat = org.sonatype.gradle.plugins.scan.ossindex.OutputFormat.JSON_CYCLONE_DX_1_4
55-
}
56-
57-
// scan-gradle-plugin accesses Task.project at execution time, which is incompatible with
58-
// Gradle 9's configuration cache. Mark the task so Gradle discards the cache entry rather
59-
// than failing the build with 44 configuration cache problems.
60-
// https://github.com/sonatype-nexus-community/scan-gradle-plugin/issues (no Gradle 9 support yet)
61-
tasks.named("ossIndexAudit") {
62-
notCompatibleWithConfigurationCache("scan-gradle-plugin is not compatible with Gradle 9 configuration cache")
55+
isPrintBanner = false
6356
}
6457

6558
val testJavaVersion = gradle.startParameter.projectProperties.get("testJavaVersion")?.let(JavaVersion::toVersion)

exporters/common/build.gradle.kts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,6 @@ testing {
104104
}
105105
}
106106

107-
// Exclude the compile-stub subproject from this module's audit: the scan plugin traverses
108-
// Gradle subprojects at execution time, which Gradle 9 forbids without an exclusive lock.
109-
// compile-stub runs its own ossIndexAudit task independently.
110-
ossIndexAudit {
111-
modulesExcluded = mutableSetOf("compile-stub")
112-
}
113-
114107
tasks {
115108
check {
116109
dependsOn(testing.suites)

integration-tests/build.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,3 @@ dependencies {
1414
testImplementation("org.junit.jupiter:junit-jupiter-params")
1515
testImplementation("org.testcontainers:testcontainers-junit-jupiter")
1616
}
17-
18-
// Skip ossIndexAudit: the scan plugin traverses Gradle subprojects at execution time, which
19-
// Gradle 9 forbids without an exclusive lock. Each subproject runs its own audit independently.
20-
tasks.named("ossIndexAudit") {
21-
enabled = false
22-
}

0 commit comments

Comments
 (0)