Skip to content

Vulnerability scanning#15631

Draft
jdaugherty wants to merge 5 commits into7.0.xfrom
vulnerabilityScanning
Draft

Vulnerability scanning#15631
jdaugherty wants to merge 5 commits into7.0.xfrom
vulnerabilityScanning

Conversation

@jdaugherty
Copy link
Copy Markdown
Contributor

Adds a vulnerability scanning workflow for grails-core

extension.username = System.getenv('SONATYPE_GUIDE_USERNAME') ?: ''
extension.password = System.getenv('SONATYPE_GUIDE_TOKEN') ?: ''
extension.excludeCoordinates = [
'org.hibernate:hibernate-core:5.6.11.Final',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesfredley @matrei We'll have to manage exceptions here.

@jdaugherty
Copy link
Copy Markdown
Contributor Author

jdaugherty commented May 5, 2026

Looks like the find main task is failing with these changes for some reason. It's likely due to the plexus update.

@jdaugherty
Copy link
Copy Markdown
Contributor Author

Root cause: Adding the Sonatype scan plugin to build-logic/plugins/build.gradle changed the build-logic's content hash, which invalidated the Gradle build cache for all subproject tasks. When findMainClass runs fresh (not from
cache), MainClassFinder tries to read compiled Java 17 class files (major version 61) using groovyjarjarasm.asm.ClassReader — the ASM bundled with Groovy 3.x — which doesn't support class file version 61. This is a pre-existing bug
that was hidden by the build cache.

The fix is to switch MainClassFinder from groovyjarjarasm.asm (Groovy's bundled, potentially old ASM) to org.objectweb.asm (the explicit ASM library, version-managed by Spring Framework BOM at 9.7+, which supports Java 17+).

@jdaugherty jdaugherty marked this pull request as draft May 5, 2026 15:08
@jdaugherty
Copy link
Copy Markdown
Contributor Author

Converting this to draft, the dependency bumps have caused gradle issues

@jdaugherty jdaugherty force-pushed the vulnerabilityScanning branch from 089db36 to d1e8460 Compare May 5, 2026 15:27
@testlens-app
Copy link
Copy Markdown

testlens-app Bot commented May 5, 2026

✅ All tests passed ✅

🏷️ Commit: d1e8460
▶️ Tests: 34054 executed
⚪️ Checks: 33/33 completed


Learn more about TestLens at testlens.app.

@jdaugherty
Copy link
Copy Markdown
Contributor Author

Alright, the problem is that the ASM classes are shaded inside scan-gradle-plugin-3.1.5.jar itself. They're not a separate transitive dependency. Gradle exclusions only work on transitive dependencies, not on classes bundled inside a fat/shaded jar. So we can't exclude them with a standard exclude rule.

The find main class is picking the shaded version, which is frustrating.

@jdaugherty
Copy link
Copy Markdown
Contributor Author

@jdaugherty
Copy link
Copy Markdown
Contributor Author

sonatype-nexus-community/scan-gradle-plugin#207 is the fix for this. We can't adopt due to the classpath conflict. I'm hopeful Sonatype will accept the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant