-
Notifications
You must be signed in to change notification settings - Fork 1.4k
build: use maven jdk toolchains to build with Java 25; test against Java 11/17/21/25 #8292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
build: use maven jdk toolchains to build with Java 25; test against Java 11/17/21/25 #8292
Conversation
25ec13a to
3c70efc
Compare
3c70efc to
2278d58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates Dependency-Check’s build and CI configuration to run Maven/compilation on a newer default JDK while expanding test coverage across multiple JDK versions, alongside related dependency and annotation cleanups.
Changes:
- Switches CI workflows to build/test in a JDK matrix (11/17/21/25) and updates caching/setup-java usage.
- Migrates nullness annotations from JetBrains to JSpecify and aligns
VisibleForTestingusage to Guava. - Updates/cleans build dependencies and Maven configuration (plugins, exclusions, test setup, toolchains profile).
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/src/test/java/org/owasp/dependencycheck/utils/XmlUtilsTest.java | Swap JetBrains nullness annotation to JSpecify in tests. |
| utils/src/main/java/org/owasp/dependencycheck/utils/XmlUtils.java | Replace JetBrains annotations with JSpecify + Guava VisibleForTesting. |
| utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Migrate nullness annotations to JSpecify across settings APIs. |
| utils/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java | Replace nullness annotations with JSpecify and adjust method annotations. |
| utils/src/main/java/org/owasp/dependencycheck/utils/Downloader.java | Replace nullness annotations with JSpecify on downloader APIs. |
| utils/pom.xml | Remove unused test deps/profile and add Guava for new annotation usage. |
| test-docker.sh | Use exec:exec goal (plugin version controlled in parent) to read project version. |
| shell-docker.sh | Use exec:exec goal (plugin version controlled in parent) to read project version. |
| publish-docker.sh | Use exec:exec goal (plugin version controlled in parent) to read project version. |
| build-docker.sh | Use exec:exec goal (plugin version controlled in parent) to read project version. |
| pom.xml | Central build changes: plugin/dependency alignment, toolchains profile, CI/test JVM args, and dependency updates. |
| maven/src/it/690-threadsafety/first/pom.xml | Bump Spring Boot patch version used in IT fixture. |
| maven/src/it/690-threadsafety/first-a/pom.xml | Bump Spring Boot patch version used in IT fixture. |
| maven/src/it/1751-use-child-repositories/postbuild.groovy | Update Groovy XmlSlurper import for newer Groovy. |
| maven/pom.xml | Simplify dependency management and configure invoker ITs to use configured Java home. |
| core/src/main/java/org/owasp/dependencycheck/xml/XmlInputStream.java | Replace JetBrains @NotNull with JSpecify @NonNull. |
| core/src/main/java/org/owasp/dependencycheck/utils/Filter.java | Remove unused JetBrains annotation import. |
| core/src/main/java/org/owasp/dependencycheck/utils/DependencyVersion.java | Replace JetBrains annotations with JSpecify on public methods. |
| core/src/main/java/org/owasp/dependencycheck/dependency/naming/PurlIdentifier.java | Replace JetBrains @NotNull with JSpecify @NonNull. |
| core/src/main/java/org/owasp/dependencycheck/dependency/naming/GenericIdentifier.java | Replace JetBrains @NotNull with JSpecify @NonNull. |
| core/src/main/java/org/owasp/dependencycheck/dependency/naming/CpeIdentifier.java | Replace JetBrains @NotNull with JSpecify @NonNull. |
| core/src/main/java/org/owasp/dependencycheck/dependency/VulnerableSoftware.java | Replace JetBrains @NotNull with JSpecify @NonNull. |
| core/src/main/java/org/owasp/dependencycheck/dependency/Vulnerability.java | Replace JetBrains @NotNull with JSpecify @NonNull and adjust javadoc reference. |
| core/src/main/java/org/owasp/dependencycheck/dependency/Reference.java | Replace JetBrains @NotNull with JSpecify @NonNull. |
| core/src/main/java/org/owasp/dependencycheck/dependency/Evidence.java | Replace JetBrains @NotNull with JSpecify @NonNull. |
| core/src/main/java/org/owasp/dependencycheck/data/update/NvdApiDataSource.java | Replace JetBrains @NotNull with JSpecify @NonNull in helper methods. |
| core/src/main/java/org/owasp/dependencycheck/data/nodeaudit/NodeAuditSearch.java | Remove explicit JSONException catch/import after JSON library adjustment. |
| core/src/main/java/org/owasp/dependencycheck/data/nexus/NexusV3Search.java | Replace JetBrains @Nullable with JSpecify @Nullable. |
| core/src/main/java/org/owasp/dependencycheck/analyzer/YarnAuditAnalyzer.java | Adjust JSON parsing of advisory ID field to tolerate non-string types. |
| core/src/main/java/org/owasp/dependencycheck/analyzer/PnpmAuditAnalyzer.java | Replace JetBrains @NotNull with JSpecify @NonNull. |
| core/src/main/java/org/owasp/dependencycheck/analyzer/HintAnalyzer.java | Replace JetBrains VisibleForTesting with Guava equivalent. |
| core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java | Replace JetBrains nullness annotations with JSpecify. |
| core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzer.java | Replace JetBrains nullness annotation with JSpecify and clean imports. |
| core/src/main/java/org/owasp/dependencycheck/Engine.java | Replace JetBrains nullness annotations with JSpecify across engine APIs. |
| core/pom.xml | Adjust test-jar configuration and update JSON dependency usage; add JCL-over-SLF4J. |
| cli/pom.xml | Reuse centralized runtime JVM args and clean dependency exclusions. |
| ant/pom.xml | Align core test-jar dependency reference to tests classifier. |
| archetype/src/main/resources/archetype-resources/pom.xml | Use ${junit.version} property instead of hardcoded JUnit versions. |
| .github/workflows/release.yml | Run release build with default JDK 25 and modernize caching/setup-java usage. |
| .github/workflows/purge-cache.yml | Update cache steps and add setup-java (now expects default JDK env var). |
| .github/workflows/pull_requests.yml | Split into matrix jobs and run unit/integration tests against 11/17/21/25. |
| .github/workflows/build.yml | Run main-branch snapshot build in a JDK test matrix with updated caching/setup-java. |
Comments suppressed due to low confidence (1)
pom.xml:936
- In
<reporting>,versions-maven-pluginno longer specifies an explicit<version>. Maven does not consistently applybuild/pluginManagementto reporting plugins, so this can lead to the site using whatever version comes from the super POM (hurting reproducibility and possibly breaking on newer JDKs). Recommend setting<version>${versions-maven-plugin.version}</version>in the reporting plugin entry as well.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
core/src/main/java/org/owasp/dependencycheck/utils/DependencyVersion.java
Outdated
Show resolved
Hide resolved
2278d58 to
2702063
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 42 out of 42 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b45977b to
711c68e
Compare
Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
…aspectjweaver-1.8.9.jar on Java 25
The zip file has an invalid header which causes newer JDK zip to fail to parse in the JarAnalyzer:
Caused by: java.util.zip.ZipException: Invalid CEN header (invalid zip64 extra data field size)
at java.util.zip.ZipFile$Source.zerror (ZipFile.java:1831)
at java.util.zip.ZipFile$Source.checkZip64ExtraFieldValues (ZipFile.java:1345)
at java.util.zip.ZipFile$Source.checkExtraFields (ZipFile.java:1305)
at java.util.zip.ZipFile$Source.checkAndAddEntry (ZipFile.java:1224)
at java.util.zip.ZipFile$Source.initCEN (ZipFile.java:1767)
at java.util.zip.ZipFile$Source.<init> (ZipFile.java:1542)
at java.util.zip.ZipFile$Source.get (ZipFile.java:1506)
at java.util.zip.ZipFile$CleanableResource.<init> (ZipFile.java:704)
at java.util.zip.ZipFile.<init> (ZipFile.java:204)
at java.util.zip.ZipFile.<init> (ZipFile.java:150)
at java.util.jar.JarFile.<init> (JarFile.java:333)
at java.util.jar.JarFile.<init> (JarFile.java:306)
at java.util.jar.JarFile.<init> (JarFile.java:265)
at org.owasp.dependencycheck.analyzer.JarAnalyzer.parseManifest (JarAnalyzer.java:856)
at org.owasp.dependencycheck.analyzer.JarAnalyzer.analyzeDependency (JarAnalyzer.java:324)
at org.owasp.dependencycheck.analyzer.AbstractAnalyzer.analyze (AbstractAnalyzer.java:131)
at org.owasp.dependencycheck.AnalysisTask.call (AnalysisTask.java:88)
at org.owasp.dependencycheck.AnalysisTask.call (AnalysisTask.java:37)
at java.util.concurrent.FutureTask.run (FutureTask.java:328)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1090)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:614)
at java.lang.Thread.run (Thread.java:1474)
Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
711c68e to
c0fd4af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 42 out of 42 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
maven/src/it/1751-use-child-repositories/postbuild.groovy:23
- This script now imports
groovy.xml.XmlSlurper. Ensure the Maven Invoker Plugin has the corresponding Groovy XML module on its classpath (oftenorg.apache.groovy:groovy-xml), otherwise this IT can fail at execution time with a missing-class error.
import groovy.xml.XmlSlurper
String report = new File(basedir, "target/dependency-check-report.xml").text;
def analysis = new XmlSlurper().parseText(report);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…le it Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
… JVMs Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
c0fd4af to
bce52f0
Compare
…est validations Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
Technically they must be ISO-8859-1, not UTF-8. Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
…matically loading annotation processors from classpath Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
- migrates to maintained org.json:json artifact - removes unnecessary excludes - fixes excludes for bouncycastle and unnecessary guava pieces Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
bce52f0 to
436ca2c
Compare
|
Sorry for the noise here. Despite running it a few times on my fork, copilot found new things here for some reason, which I addressed. 😅 I am done for now, pending feedback 🙏 |
Description of Change
As discussed in #8275 (comment) this change switches Dependency Check to
-releasetarget is still Java 11 (as before), ensuring compile time andbootclasspathcompatibility.This should allow us to
Additional detail
In order to do this and ensure it is as safe as possible this change as a side effect:
Dev Experience
-Dtoolchain.jdk.test.version(and-Dtoolchain.jdk.test.homefor maven integration tests, unfortunately) which activates a Maven profileGitHub Actions
setup-javato manage primary maven cache rather than doing manuallymain/releaseDependencies
org.jspecify:jspecifysimilar to other projects (rather than jetbrains annotations)org.jsonlibrary to supported variant rather than stale google android forkmockserverdependencybouncycastledependency frompackager-rpmas originally intendedmavenplugin projectmavenproject from the resolver BOMRelated issues
N/A
Have test cases been added to cover the new functionality?
yes
main(see this run)antandclibuild archives to ensure any differences in dependencies are expectedsitegeneration