Skip to content

fix: disable central analyzer and resolve pom.xml via gradle#470

Merged
jeremylong merged 8 commits intomainfrom
gradle-poms
Oct 12, 2025
Merged

fix: disable central analyzer and resolve pom.xml via gradle#470
jeremylong merged 8 commits intomainfrom
gradle-poms

Conversation

@jeremylong
Copy link
Copy Markdown
Contributor

resolves #468

  • Disables the Central Analyzer by default
  • Retrieves pom.xml files from gradle cache

@jeremylong
Copy link
Copy Markdown
Contributor Author

This PR was tested manually.

@jeremylong
Copy link
Copy Markdown
Contributor Author

@chadlwilson any concerns with this PR?

@jeremylong jeremylong requested a review from Copilot October 11, 2025 19:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the issue of false negatives in dependency scanning by disabling the central analyzer and implementing a custom POM resolution mechanism. The changes enable retrieval of Maven POM files directly from the Gradle cache, which provides better accuracy in dependency analysis without relying on the central analyzer.

Key changes:

  • Disables the central analyzer by default in configuration
  • Adds POM resolution functionality using Gradle's artifact resolution query API
  • Integrates POM analysis into both legacy and modern dependency processing flows

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/main/resources/task.properties Enables the central analyzer disable flag and removes explanatory comments
src/main/groovy/org/owasp/dependencycheck/gradle/tasks/AbstractAnalyze.groovy Implements POM resolution logic with caching and integrates it into dependency processing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/main/groovy/org/owasp/dependencycheck/gradle/tasks/AbstractAnalyze.groovy Outdated
Comment thread src/main/groovy/org/owasp/dependencycheck/gradle/tasks/AbstractAnalyze.groovy Outdated
Comment thread src/main/groovy/org/owasp/dependencycheck/gradle/tasks/AbstractAnalyze.groovy Outdated
Comment thread src/main/groovy/org/owasp/dependencycheck/gradle/tasks/AbstractAnalyze.groovy Outdated
@jeremylong jeremylong merged commit bbe26b4 into main Oct 12, 2025
3 checks passed
@jeremylong jeremylong deleted the gradle-poms branch October 12, 2025 12:51
@chadlwilson
Copy link
Copy Markdown
Collaborator

I don't disagree with the defaults here, however we may want to add a note to the changelog - something like

If your Gradle build relies on scanning non-Gradle artifacts or archives from other ecosystems which contain jars, you may want to consider re-enabling Central using analyzers.centralEnabled, or the Nexus/Artifactory analyzers as an alternative.

WDYT?

In my specific case we use the Gradle plugin as an entry-point to run ODC, however as a multi-language JRuby project I do want it to look at jars inside Ruby gems, for example.

@jeremylong
Copy link
Copy Markdown
Contributor Author

release notes updated. I'll also add this to the documentation site somehow...

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gradle plugin takes over 3 hours to fail when search.maven.org down

3 participants