question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to exclude transitive dependencies from a scan?

See original GitHub issue

Hi,

I am using the ./gradlew dependencyCheckAggregate command to generate the dependency report HTML file for one of my Gradle projects. It works fine and lists both direct and transitive jar dependencies which are vulnerable as per the NVD database. However, I tried multiple ways but failed to figure out a way wherein I want to only list the direct dependencies? Is there any way through which I can list the direct dependencies only? Below is the build.gradle file for reference –

File snippet -

plugins {
    id 'org.owasp.dependencycheck' version '6.5.3'
}
repositories {
    mavenCentral()
}
subprojects {
    apply plugin: 'org.owasp.dependencycheck'

    dependencyCheck {
        outputDirectory = 'security-report'
        failOnError = true
    }
}

Is this some feature that is missing from this plugin? or something else? Please confirm.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jeremylongcommented, Jan 26, 2022

I won’t disagree that when using the maven or gradle plugin we could do better about indicating where in the dependency tree the vulnerable component is - however, how much one should worry about the transitive dependencies is complicated.

  1. One can have Used but undeclared dependencies (see an example dependency-analysis report
  2. The risk actually affects your application even if it is only a transitive dependency; which could have happened with the recent log4j event.

Yes, upgrading transitive dependencies can be difficult and sometimes impossible unless you are willing to put in a PR to the direct dependency to help them upgrade. However, just ignoring them is likely not the best option.

0reactions
jeremylongcommented, Jan 30, 2022

@aikebah I have been trying to come up with an easier way for Maven and Gradle to display the dependency tree for transitive deps. Something like adding a row above related dependencies that shows the path:

Hierarchy org.junit.jupiter:junit-jupiter-api -> org.apiguardian:apiguardian-api

Read more comments on GitHub >

github_iconTop Results From Across the Web

maven - How to exclude a transitive dependency inside a ...
1 Answer 1 ... It seems like the dependency "jackson databind" is not pulled by Maven, so their is no way to exclude...
Read more >
Downgrading versions and excluding dependencies
Transitive dependencies can be excluded on the level of a declared dependency. Exclusions are spelled out as a key/value pair via the attributes...
Read more >
Is it possible to exclude transitive dependencies while running ...
This command will not stop transitive dependencies from been found when scanning. Product. Black Duck/Black Duck Hub. Version. 2020.4.1.
Read more >
Maven – Optional Dependencies and Dependency Exclusions
The answer is Yes. Project-A has declared that it doesn't need Project-D to run, so it won't be brought in as a transitive...
Read more >
Gradle dependencies | IntelliJ IDEA Documentation - JetBrains
Required plugins for adding Gradle dependencies: Maven and Maven ... Besides the transitive dependencies, IntelliJ IDEA also indicates ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found