Skip to content
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

11.0.0 failing with NoSuchMethodError #7098

Open
Grimoren opened this issue Oct 24, 2024 · 26 comments
Open

11.0.0 failing with NoSuchMethodError #7098

Grimoren opened this issue Oct 24, 2024 · 26 comments
Labels

Comments

@Grimoren
Copy link

Describe the bug
A clear and concise description of what the bug is.
Latest version 11.0.0 failing with

 Caused by: org.owasp.dependencycheck.exception.ExceptionCollection: One or more exceptions occurred during analysis:
 	InitializationException: Unexpected Exception
 		caused by NoSuchMethodError: 'org.apache.commons.io.input.BOMInputStream$Builder org.apache.commons.io.input.BOMInputStream.builder()'
 	InitializationException: Unexpected Exception
 		caused by NoSuchMethodError: 'org.apache.commons.io.input.BOMInputStream$Builder org.apache.commons.io.input.BOMInputStream.builder()'
 	InitializationException: Unexpected Exception
 		caused by NoSuchMethodError: 'org.apache.commons.io.input.BOMInputStream$Builder org.apache.commons.io.input.BOMInputStream.builder()'
 	at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:693)

Version of dependency-check used
The problem occurs using version 11.0.0 of the gradle plugin

Log file
When reporting errors, 99% of the time log file output is required. Please post the log file as a gist and provide a link in the new issue.

https://gist.github.com/Grimoren/724ccf0baf8c6a28fae9b77cf676f54d

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
DependencyCheckAggregate finishes with no error.

Additional context
Add any other context about the problem here.

@Grimoren Grimoren added the bug label Oct 24, 2024
@aikebah
Copy link
Collaborator

aikebah commented Oct 24, 2024

Looks like you suffer from other parts of your gradle build replacing DependencyCheck's commons-io dependency (2.17.0) with an incompatible older version (older than 2.12.0, given that commons-io documents the method as since: 2.12.0)

@aikebah aikebah added question and removed bug labels Oct 24, 2024
@Grimoren
Copy link
Author

I checked the dependencies and it's showing commons-io 2.17.0

I wonder if there is an issue with dichotomy of buildSrc and kotlin plugins.

I didn't encounter the issue with the typical setup groovy classpath/plugin application

@Grimoren
Copy link
Author

I did also get this blob before the failure at the end

Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/2/pom.xml'
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/1/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/2.0.13/80229737f704b121a318bba5d5deacbcf395bc77/slf4j-api-2.0.13.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/4/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/com.github.jknack/handlebars/4.4.0/6d7949a7e2aee534198ca91a8912357002af4020/handlebars-4.4.0.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/5/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/org.openapitools/jackson-databind-nullable/0.2.1/d069cce2528dae0475d5e4bd04f01017afe1e7cd/jackson-databind-nullable-0.2.1.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/3/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.17.0/880a742337010da4c851f843d8cac150e22dff9f/jackson-annotations-2.17.0.jar'.
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-text/1.11.0/2bb044b7717ec2eccaf9ea7769c1509054b50e9a/commons-text-1.11.0.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/6/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.17.0/a6e5058ef9720623c517252d17162f845306ff3a/jackson-core-2.17.0.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/7/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/com.github.jknack/handlebars/4.4.0/6d7949a7e2aee534198ca91a8912357002af4020/handlebars-4.4.0.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/8/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.17.0/3fab507bba9d477e52ed2302dc3ddbd23cbae339/jackson-datatype-jsr310-2.17.0.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/9/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/25ea2e8b0c338a877313bd4672d3fe056ea78f0d/jsr305-3.0.2.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/10/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/2.0.16/172931663a09a1fa515567af5fbef00897d3c04/slf4j-api-2.0.16.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/11/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/jakarta.annotation/jakarta.annotation-api/1.3.5/59eb84ee0d616332ff44aba065f3888cf002cd2d/jakarta.annotation-api-1.3.5.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/12/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.14.0/1ed471194b02f2c6cb734a0cd6f6f107c673afae/commons-lang3-3.14.0.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/14/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.14.1/f24e8cb1437e05149b7a3049ebd6700f42e664b1/jackson-datatype-jsr310-2.14.1.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/13/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.14.1/2a6ad504d591a7903ffdec76b5b7252819a2d162/jackson-annotations-2.14.1.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/15/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.14.1/7a07bc535ccf0b7f6929c4d0f2ab9b294ef7c4a3/jackson-core-2.14.1.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/16/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.17.0/7173e9e1d4bc6d7ca03bc4eeedcd548b8b580b34/jackson-databind-2.17.0.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/17/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.14.1/268524b9056cae1211b9f1f52560ef19347f4d17/jackson-databind-2.14.1.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/18/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.14.9/b69e7fff6c473d3ed2b489cdfd673a091fd94226/byte-buddy-1.14.9.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/19/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j2-impl/2.24.0/3d550671b19e83591d5e66cc8c77272e7aaac34c/log4j-slf4j2-impl-2.24.0.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/20/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.24.0/c6d9bd0c95c9bb6c530f4800da9507b98f018654/log4j-api-2.24.0.jar'.
Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/21/pom.xml'
An error occurred while analyzing '/Users/saitx/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.24.0/537543d3b84d78b4d7ad055c98f8af13e5e7f3a8/log4j-core-2.24.0.jar'.

@Grimoren
Copy link
Author

Added to gist

@Grimoren
Copy link
Author

gradle buildEnvironment:

      +--- org.owasp:dependency-check-gradle:11.0.0
      |    +--- org.owasp:dependency-check-core:11.0.0
      |    |    +--- io.github.jeremylong:open-vulnerability-clients:7.0.0
      |    |    |    +--- org.apache.httpcomponents.client5:httpclient5:5.4
      |    |    |    |    +--- org.apache.httpcomponents.core5:httpcore5:5.3
      |    |    |    |    +--- org.apache.httpcomponents.core5:httpcore5-h2:5.3
      |    |    |    |    |    \--- org.apache.httpcomponents.core5:httpcore5:5.3
      |    |    |    |    \--- org.slf4j:slf4j-api:1.7.36 -> 2.0.12
      |    |    |    +--- com.fasterxml.jackson:jackson-bom:2.17.2 -> 2.18.0
      |    |    |    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.18.0 (c)
      |    |    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.18.0 (c)
      |    |    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.18.0 (c)
      |    |    |    |    +--- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.0 (c)
      |    |    |    |    +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.0 (c)
      |    |    |    |    +--- com.fasterxml.jackson.module:jackson-module-afterburner:2.18.0 (c)
      |    |    |    |    \--- com.fasterxml.jackson.module:jackson-module-blackbird:2.18.0 (c)
      |    |    |    +--- com.fasterxml.jackson.core:jackson-databind -> 2.18.0
      |    |    |    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.18.0
      |    |    |    |    |    \--- com.fasterxml.jackson:jackson-bom:2.18.0 (*)
      |    |    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.18.0
      |    |    |    |    |    \--- com.fasterxml.jackson:jackson-bom:2.18.0 (*)
      |    |    |    |    \--- com.fasterxml.jackson:jackson-bom:2.18.0 (*)
      |    |    |    +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310 -> 2.18.0
      |    |    |    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.18.0 (*)
      |    |    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.18.0 (*)
      |    |    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.18.0 (*)
      |    |    |    |    \--- com.fasterxml.jackson:jackson-bom:2.18.0 (*)
      |    |    |    \--- com.samskivert:jmustache:1.16
      |    |    +--- org.anarres.jdiagnostics:jdiagnostics:1.0.7
      |    |    +--- org.whitesource:pecoff4j:0.0.2.1
      |    |    +--- org.apache.commons:commons-jcs3-core:3.2.1
      |    |    +--- io.github.jeremylong:jcs3-slf4j:1.0.5
      |    |    |    +--- org.apache.commons:commons-jcs3-core:3.0 -> 3.2.1
      |    |    |    \--- org.slf4j:slf4j-api:1.7.36 -> 2.0.12
      |    |    +--- com.github.package-url:packageurl-java:1.5.0
      |    |    +--- us.springett:cpe-parser:2.1.0
      |    |    |    \--- org.slf4j:slf4j-api:1.7.36 -> 2.0.12
      |    |    +--- org.semver4j:semver4j:5.4.0
      |    |    +--- org.slf4j:slf4j-api:1.7.36 -> 2.0.12
      |    |    +--- org.owasp:dependency-check-utils:11.0.0
      |    |    |    +--- commons-io:commons-io:2.17.0
      |    |    |    +--- org.apache.commons:commons-lang3:3.17.0
      |    |    |    +--- org.apache.httpcomponents.client5:httpclient5:5.4 (*)
      |    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.18.0 (*)
      |    |    |    \--- org.slf4j:slf4j-api:1.7.36 -> 2.0.12
      |    |    +--- org.apache.commons:commons-collections4:4.4
      |    |    +--- org.apache.commons:commons-compress:1.27.1
      |    |    |    +--- commons-codec:commons-codec:1.17.1
      |    |    |    +--- commons-io:commons-io:2.16.1 -> 2.17.0
      |    |    |    \--- org.apache.commons:commons-lang3:3.16.0 -> 3.17.0
      |    |    +--- commons-io:commons-io:2.17.0
      |    |    +--- org.apache.commons:commons-lang3:3.17.0
      |    |    +--- org.apache.commons:commons-text:1.12.0
      |    |    |    \--- org.apache.commons:commons-lang3:3.14.0 -> 3.17.0
      |    |    +--- org.apache.commons:commons-dbcp2:2.12.0
      |    |    |    +--- org.apache.commons:commons-pool2:2.12.0
      |    |    |    +--- commons-logging:commons-logging:1.3.0 -> 1.3.2
      |    |    |    \--- jakarta.transaction:jakarta.transaction-api:1.3.3
      |    |    +--- org.apache.lucene:lucene-core:9.12.0
      |    |    +--- org.apache.lucene:lucene-analysis-common:9.12.0
      |    |    |    \--- org.apache.lucene:lucene-core:9.12.0
      |    |    +--- org.apache.lucene:lucene-queryparser:9.12.0
      |    |    |    +--- org.apache.lucene:lucene-core:9.12.0
      |    |    |    +--- org.apache.lucene:lucene-queries:9.12.0
      |    |    |    |    \--- org.apache.lucene:lucene-core:9.12.0
      |    |    |    \--- org.apache.lucene:lucene-sandbox:9.12.0
      |    |    |         +--- org.apache.lucene:lucene-core:9.12.0
      |    |    |         +--- org.apache.lucene:lucene-queries:9.12.0 (*)
      |    |    |         \--- org.apache.lucene:lucene-facet:9.12.0
      |    |    |              \--- org.apache.lucene:lucene-core:9.12.0
      |    |    +--- org.apache.velocity:velocity-engine-core:2.3
      |    |    |    +--- org.apache.commons:commons-lang3:3.11 -> 3.17.0
      |    |    |    \--- org.slf4j:slf4j-api:1.7.30 -> 2.0.12
      |    |    +--- com.h2database:h2:2.3.232
      |    |    +--- org.glassfish:javax.json:1.1.4
      |    |    +--- org.jsoup:jsoup:1.18.1
      |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.18.0 (*)
      |    |    +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.0 (*)
      |    |    +--- com.fasterxml.jackson.module:jackson-module-afterburner:2.18.0
      |    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.18.0 (*)
      |    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.18.0 (*)
      |    |    |    \--- com.fasterxml.jackson:jackson-bom:2.18.0 (*)
      |    |    +--- com.fasterxml.jackson.module:jackson-module-blackbird:2.18.0
      |    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.18.0 (*)
      |    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.18.0 (*)
      |    |    |    \--- com.fasterxml.jackson:jackson-bom:2.18.0 (*)
      |    |    +--- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.0
      |    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.18.0 (*)
      |    |    |    +--- org.yaml:snakeyaml:2.2
      |    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.18.0 (*)
      |    |    |    \--- com.fasterxml.jackson:jackson-bom:2.18.0 (*)
      |    |    +--- com.h3xstream.retirejs:retirejs-core:3.0.4
      |    |    |    +--- com.vaadin.external.google:android-json:0.0.20131108.vaadin1
      |    |    |    +--- com.esotericsoftware:minlog:1.3.1
      |    |    |    \--- com.github.spullara.mustache.java:compiler:0.9.6
      |    |    +--- org.sonatype.ossindex:ossindex-service-client:1.8.2
      |    |    |    +--- org.sonatype.ossindex:ossindex-service-api:1.8.2
      |    |    |    |    +--- org.slf4j:slf4j-api:1.7.28 -> 2.0.12
      |    |    |    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.9.10 -> 2.18.0 (*)
      |    |    |    |    +--- javax.xml.bind:jaxb-api:2.3.1
      |    |    |    |    |    \--- javax.activation:javax.activation-api:1.2.0
      |    |    |    |    +--- javax.ws.rs:javax.ws.rs-api:2.0.1
      |    |    |    |    \--- org.sonatype.goodies:package-url-java:1.1.1
      |    |    |    +--- javax.inject:javax.inject:1
      |    |    |    +--- org.slf4j:slf4j-api:1.7.28 -> 2.0.12
      |    |    |    +--- joda-time:joda-time:2.10.4
      |    |    |    +--- com.google.code.gson:gson:2.9.0
      |    |    |    \--- javax.xml.bind:jaxb-api:2.3.1 (*)
      |    |    +--- com.google.guava:guava:33.3.1-jre
      |    |    |    +--- com.google.guava:failureaccess:1.0.2
      |    |    |    +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
      |    |    |    +--- com.google.code.findbugs:jsr305:3.0.2
      |    |    |    +--- org.checkerframework:checker-qual:3.43.0
      |    |    |    +--- com.google.errorprone:error_prone_annotations:2.28.0
      |    |    |    \--- com.google.j2objc:j2objc-annotations:3.0.0
      |    |    +--- com.moandjiezana.toml:toml4j:0.7.2
      |    |    |    \--- com.google.code.gson:gson:2.8.1 -> 2.9.0
      |    |    +--- com.hankcs:aho-corasick-double-array-trie:1.2.3
      |    |    +--- commons-validator:commons-validator:1.9.0
      |    |    |    +--- commons-beanutils:commons-beanutils:1.9.4
      |    |    |    |    +--- commons-logging:commons-logging:1.2 -> 1.3.2
      |    |    |    |    \--- commons-collections:commons-collections:3.2.2
      |    |    |    +--- commons-digester:commons-digester:2.1
      |    |    |    +--- commons-logging:commons-logging:1.3.2
      |    |    |    \--- commons-collections:commons-collections:3.2.2
      |    |    +--- commons-beanutils:commons-beanutils:1.9.4 (*)
      |    |    \--- org.eclipse.packager:packager-rpm:0.21.0
      |    |         +--- org.eclipse.packager:packager-core:0.21.0
      |    |         |    +--- org.bouncycastle:bcprov-jdk18on:1.78
      |    |         |    \--- org.bouncycastle:bcpg-jdk18on:1.78
      |    |         |         \--- org.bouncycastle:bcprov-jdk18on:1.78
      |    |         +--- org.slf4j:slf4j-api:2.0.12
      |    |         +--- org.apache.commons:commons-compress:1.26.1 -> 1.27.1 (*)
      |    |         +--- commons-codec:commons-codec:1.16.1 -> 1.17.1
      |    |         +--- com.google.guava:guava:33.1.0-jre -> 33.3.1-jre (*)
      |    |         \--- org.tukaani:xz:1.9
      |    +--- org.owasp:dependency-check-utils:11.0.0 (*)
      |    +--- io.github.jeremylong:open-vulnerability-clients:6.1.7 -> 7.0.0 (*)
      |    \--- net.gpedro.integrations.slack:slack-webhook:1.4.0
      |         \--- com.google.code.gson:gson:2.3.1 -> 2.9.0
      \--- org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:5.0.0.4638
           \--- org.sonarsource.scanner.api:sonar-scanner-api:2.16.2.588

@Grimoren
Copy link
Author

Hmm... looks like gradle has it's own version:

(base) saitx@Keiths-MBP-401 classpathDump % searchJars BOMInputStream
Searching current directory for class/file name: BOMInputStream
(standard input): 1988 Sun Sep 15 14:44:32 PDT 2024 org/apache/commons/io/input/BOMInputStream$Builder.class
(standard input): 6469 Sun Sep 15 14:44:32 PDT 2024 org/apache/commons/io/input/BOMInputStream.class
commons-io-2.17.0.jar
(standard input): 2464 Fri Feb 01 00:00:00 PST 1980 org/gradle/internal/impldep/org/apache/commons/io/input/BOMInputStream$Builder.class
(standard input): 6943 Fri Feb 01 00:00:00 PST 1980 org/gradle/internal/impldep/org/apache/commons/io/input/BOMInputStream.class
gradle-api-8.10.2.jar

@Grimoren
Copy link
Author

Grimoren commented Oct 24, 2024

Although that should be relocated to the package org.gradle.internal.impldep.org.apache.commons.io.input
instead of org.apache.commons.io.input. So that shouldn't affect this.

@Grimoren
Copy link
Author

Verified it doesn't have the issue in my groovy project. So it seems to be something in the Kotlin files/plugins.

@aikebah
Copy link
Collaborator

aikebah commented Oct 24, 2024

I did also get this blob before the failure at the end

Unexpected error during parsing of the pom '/var/folders/58/8r7gvck557x_49qm2bbl4tzc0000gn/T/dctemp7a40542d-1e44-46da-98fc-9eefb5035bdd/check10301371309261096767tmp/2/pom.xml'

Those errors will be the mentioned NoSuchMethodErrors

@aikebah
Copy link
Collaborator

aikebah commented Oct 24, 2024

Your buildEnvironment looks clean, not an experienced gradler myself, so not sure if in some way the buildEnvironment can in obscure ways not show (all) the actual libraries that are in the classpath when the plugin is executed; can you try to see what happens when you explicitly pin it to commons-io 2.17.0?

See https://github.com/jeremylong/DependencyCheck?tab=readme-ov-file#gradle-build-environment

@Grimoren
Copy link
Author

No luck with forcing the version. Still the same error.

@Grimoren
Copy link
Author

This behavior does remind of when I get a dependency with shaded classes (without relocation). I wonder if there is something shaded in here, somewhere.

@Grimoren
Copy link
Author

Grimoren commented Oct 24, 2024

Seems to be specifically with kotlin-dsl plugin applied. Will look into making a minimum example.

@hoeller
Copy link

hoeller commented Oct 25, 2024

Your buildEnvironment looks clean, not an experienced gradler myself, so not sure if in some way the buildEnvironment can in obscure ways not show (all) the actual libraries that are in the classpath when the plugin is executed; can you try to see what happens when you explicitly pin it to commons-io 2.17.0?

See https://github.com/jeremylong/DependencyCheck?tab=readme-ov-file#gradle-build-environment

I got it working by pinning the dependency just the way described in the README. Had to already do it for commons-lang and jackson-databind. This may not be necessary for your project.

buildSrc/build.gradle.kts

plugins {
    `kotlin-dsl`
}

/**
 * gradle plugins and plugin dependencies go here
 */
dependencies {
    // ...
    implementation("org.apache.commons:commons-lang3:3.17.0") // required by owasp dependency check
    implementation("com.fasterxml.jackson.core:jackson-databind:2.18.0") // required by owasp dependency check
    implementation("commons-io:commons-io:2.17.0") // required by owasp dependency check
}

@Grimoren
Copy link
Author

I'll give that a try. Didn't have the issue with jackson/commons-lang3 but I will keep that in mind.

@Grimoren
Copy link
Author

No luck. Same error

@jeremylong
Copy link
Owner

Not sure I'll have much time for the next two weeks - but do you have a sample build.gradle that replicates the problem?

@jeremylong
Copy link
Owner

Just tried to reproduce this with gradle 8.10.2 - and everything worked as expected on my side. At this point we would need a sample project (doesn't need source - just the build.gradle and possibly settings.gradle).

@floorleap
Copy link

I had the same issue, but in my case I managed to narrow it down to an older gradle plugin that still had a dependency on commons-io:2.11.0.

It can be hard to find, as the regular gradle dependencies or gradle buildEnvironment output doesn't include dependencies for plugins. But commenting out the plugin resolved the issue for me.

@Grimoren
Copy link
Author

Let me try that. I'll get back to you on whether that works or if I can get a working build ( current is using a lot of internal libraries)

@Grimoren
Copy link
Author

Grimoren commented Nov 4, 2024

SO I went through the dependencies in build
buildSrc/build.gradle.kts

plugins {
    // Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build.
    `kotlin-dsl`

    // applies the spotless plugin to the buildSrc project only
    id("com.diffplug.spotless") version "6.25.0"
}


dependencies {
    // see https://projectlombok.org/setup/gradle
    implementation("io.freefair.gradle:lombok-plugin:8.10.2")

    // see https://github.com/diffplug/spotless/blob/main/plugin-gradle/README.md
    implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")

    // see https://imperceptiblethoughts.com/shadow/configuration/
    implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.5")

    // this is the dependency that has the latest 
    implementation("group: "org.owasp", name: "dependency-check-gradle", version: "11.1.0")
}


// buildSrc project has gradle kotlin in non-conventional directories
spotless {
    kotlinGradle {
        target("**/*.gradle.kts")
        ktlint()
    }
}

I even upgraded from john rengelman shadow to gradleup. It's still failing with the same error in dependencyCheckAggregate

@Grimoren
Copy link
Author

Grimoren commented Nov 4, 2024

gradle wrapper is 8.10.2

@Grimoren
Copy link
Author

Grimoren commented Nov 4, 2024

Root caused it:
There is a plugin being applied in the setting.kotlin.gradle:
it seems to be shading/forcing an old version of commons-io

plugins {
    // Nyx maintainers recommend applying this plugin at the settings level, so that it is evaluated as early as possible
    // see https://mooltiverse.github.io/nyx/guide/user/introduction/usage/#apply-the-plugin
    id("com.mooltiverse.oss.nyx") version "3.0.0"
}

configure<com.mooltiverse.oss.nyx.gradle.NyxExtension> {
    preset = "simple"
    stateFile = "build/.nyx-state.yml"

    releaseTypes {
        items {
            register("mainline") {
                // this is what we need to change
                gitTag = "true"
                matchEnvironmentVariables.put("CI", "^true$")

                // but all of this has to come along for the ride, as Nyx does not support partial overrides of ReleaseType
                filterTags = "^({{configuration.releasePrefix}})?([0-9]\\d*)\\.([0-9]\\d*)\\.([0-9]\\d*)$"
                gitTagNames = listOf("{{version}}")
                matchBranches = "^(master|main)$"
                matchWorkspaceStatus = "CLEAN"
            }
        }
    }
}

@Grimoren
Copy link
Author

Grimoren commented Nov 4, 2024

Even the latest version is causing issues.

@Grimoren
Copy link
Author

Grimoren commented Nov 4, 2024

So nothing can be done on the dependency check side. Maybe just add some documentation to doublecheck the settings plugins if experiencing this issue.

@jeremylong
Copy link
Owner

You might be able to force the dependency resolution strategy for the build scripts to resolve in your build. https://stackoverflow.com/a/72347306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants