Closed rpanman-sonatype closed 2 years ago
Thanks for the report @rpanman-sonatype.
As discussed on Slack, this seems to be related to a gradle
version issue.
Currently the plugin favours a global gradle
command over ./gradlew
which may be in your project. The plugin essentially runs:
gradle dependencies --configuration runtimeClasspath
or, if gradle
is not on your path it will look to try to run ./gradlew dependencies --configuration runtimeClasspath
.
@DarthHater - would you have any thoughts / objection on us switching to favouring ./gradlew
over gradle
?
FYI: @ctownshend / @hboutemy
Project used to triage: https://github.com/sonatype-nexus-community/nexusiq-successmetrics
My gradle version:
gradle -v
------------------------------------------------------------
Gradle 6.9.1
------------------------------------------------------------
Build time: 2021-08-20 11:15:18 UTC
Revision: f0ddb54aaae0e44f0a7209c3c0274d506ea742a0
Kotlin: 1.4.20
Groovy: 2.5.12
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
Output:
gradle dependencies --configuration runtimeClasspath
FAILURE: Build failed with an exception.
* What went wrong:
'org.gradle.api.tasks.SourceSetContainer org.gradle.api.plugins.JavaPluginExtension.getSourceSets()'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 952ms
./gradlew dependencies --configuration runtimeClasspath
Welcome to Gradle 7.2!
Here are the highlights of this release:
- Toolchain support for Scala
- More cache hits when Java source files have platform-specific line endings
- More resilient remote HTTP build cache behavior
For more details see https://docs.gradle.org/7.2/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :dependencies
------------------------------------------------------------
Root project 'successmetrics'
------------------------------------------------------------
runtimeClasspath - Runtime classpath of source set 'main'.
+--- org.springframework.boot:spring-boot-devtools -> 2.5.6
| +--- org.springframework.boot:spring-boot:2.5.6
| | +--- org.springframework:spring-core:5.3.12
| | | \--- org.springframework:spring-jcl:5.3.12
| | \--- org.springframework:spring-context:5.3.12
| | +--- org.springframework:spring-aop:5.3.12
| | | +--- org.springframework:spring-beans:5.3.12
| | | | \--- org.springframework:spring-core:5.3.12 (*)
| | | \--- org.springframework:spring-core:5.3.12 (*)
| | +--- org.springframework:spring-beans:5.3.12 (*)
| | +--- org.springframework:spring-core:5.3.12 (*)
| | \--- org.springframework:spring-expression:5.3.12
| | \--- org.springframework:spring-core:5.3.12 (*)
| \--- org.springframework.boot:spring-boot-autoconfigure:2.5.6
| \--- org.springframework.boot:spring-boot:2.5.6 (*)
+--- org.springframework.boot:spring-boot-starter -> 2.5.6
| +--- org.springframework.boot:spring-boot:2.5.6 (*)
| +--- org.springframework.boot:spring-boot-autoconfigure:2.5.6 (*)
| +--- org.springframework.boot:spring-boot-starter-logging:2.5.6
| | +--- ch.qos.logback:logback-classic:1.2.6
| | | +--- ch.qos.logback:logback-core:1.2.6
| | | \--- org.slf4j:slf4j-api:1.7.32
| | +--- org.apache.logging.log4j:log4j-to-slf4j:2.14.1
| | | +--- org.slf4j:slf4j-api:1.7.25 -> 1.7.32
| | | \--- org.apache.logging.log4j:log4j-api:2.14.1
| | \--- org.slf4j:jul-to-slf4j:1.7.32
| | \--- org.slf4j:slf4j-api:1.7.32
| +--- jakarta.annotation:jakarta.annotation-api:1.3.5
| +--- org.springframework:spring-core:5.3.12 (*)
| \--- org.yaml:snakeyaml:1.28
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.5.6
| +--- org.springframework.boot:spring-boot-starter:2.5.6 (*)
| +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.5.6
| | +--- com.fasterxml.jackson.core:jackson-databind:2.12.5
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.12.5
| | | | \--- com.fasterxml.jackson:jackson-bom:2.12.5
| | | | +--- junit:junit:4.13.1 -> 4.13.2 (c)
| | | | +--- com.fasterxml.jackson.core:jackson-annotations:2.12.5 (c)
| | | | +--- com.fasterxml.jackson.core:jackson-core:2.12.5 (c)
| | | | +--- com.fasterxml.jackson.core:jackson-databind:2.12.5 (c)
| | | | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.5 (c)
| | | | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.5 (c)
| | | | \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.12.5 (c)
| | | +--- com.fasterxml.jackson.core:jackson-core:2.12.5
| | | | \--- com.fasterxml.jackson:jackson-bom:2.12.5 (*)
| | | \--- com.fasterxml.jackson:jackson-bom:2.12.5 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.5
| | | +--- com.fasterxml.jackson.core:jackson-annotations:2.12.5 (*)
| | | +--- com.fasterxml.jackson.core:jackson-core:2.12.5 (*)
| | | +--- com.fasterxml.jackson.core:jackson-databind:2.12.5 (*)
| | | \--- com.fasterxml.jackson:jackson-bom:2.12.5 (*)
| | +--- org.springframework.boot:spring-boot-actuator:2.5.6
| | | \--- org.springframework.boot:spring-boot:2.5.6 (*)
| | +--- org.springframework.boot:spring-boot:2.5.6 (*)
| | \--- org.springframework.boot:spring-boot-autoconfigure:2.5.6 (*)
| \--- io.micrometer:micrometer-core:1.7.5
| +--- org.hdrhistogram:HdrHistogram:2.1.12
| \--- org.latencyutils:LatencyUtils:2.0.3
+--- org.springframework.boot:spring-boot-starter-thymeleaf -> 2.5.6
| +--- org.springframework.boot:spring-boot-starter:2.5.6 (*)
| +--- org.thymeleaf:thymeleaf-spring5:3.0.12.RELEASE
| | +--- org.thymeleaf:thymeleaf:3.0.12.RELEASE
| | | +--- ognl:ognl:3.1.26
| | | | \--- org.javassist:javassist:3.20.0-GA -> 3.27.0-GA
| | | +--- org.attoparser:attoparser:2.0.5.RELEASE
| | | +--- org.unbescape:unbescape:1.1.6.RELEASE
| | | \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.32
| | \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.32
| \--- org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.4.RELEASE
| +--- org.thymeleaf:thymeleaf:3.0.11.RELEASE -> 3.0.12.RELEASE (*)
| \--- org.slf4j:slf4j-api:1.7.25 -> 1.7.32
+--- org.springframework.boot:spring-boot-starter-web -> 2.5.6
| +--- org.springframework.boot:spring-boot-starter:2.5.6 (*)
| +--- org.springframework.boot:spring-boot-starter-json:2.5.6
| | +--- org.springframework.boot:spring-boot-starter:2.5.6 (*)
| | +--- org.springframework:spring-web:5.3.12
| | | +--- org.springframework:spring-beans:5.3.12 (*)
| | | \--- org.springframework:spring-core:5.3.12 (*)
| | +--- com.fasterxml.jackson.core:jackson-databind:2.12.5 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.5
| | | +--- com.fasterxml.jackson.core:jackson-core:2.12.5 (*)
| | | +--- com.fasterxml.jackson.core:jackson-databind:2.12.5 (*)
| | | \--- com.fasterxml.jackson:jackson-bom:2.12.5 (*)
| | +--- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.5 (*)
| | \--- com.fasterxml.jackson.module:jackson-module-parameter-names:2.12.5
| | +--- com.fasterxml.jackson.core:jackson-core:2.12.5 (*)
| | +--- com.fasterxml.jackson.core:jackson-databind:2.12.5 (*)
| | \--- com.fasterxml.jackson:jackson-bom:2.12.5 (*)
| +--- org.springframework.boot:spring-boot-starter-tomcat:2.5.6
| | +--- jakarta.annotation:jakarta.annotation-api:1.3.5
| | +--- org.apache.tomcat.embed:tomcat-embed-core:9.0.54
| | +--- org.apache.tomcat.embed:tomcat-embed-el:9.0.54
| | \--- org.apache.tomcat.embed:tomcat-embed-websocket:9.0.54
| | \--- org.apache.tomcat.embed:tomcat-embed-core:9.0.54
| +--- org.springframework:spring-web:5.3.12 (*)
| \--- org.springframework:spring-webmvc:5.3.12
| +--- org.springframework:spring-aop:5.3.12 (*)
| +--- org.springframework:spring-beans:5.3.12 (*)
| +--- org.springframework:spring-context:5.3.12 (*)
| +--- org.springframework:spring-core:5.3.12 (*)
| +--- org.springframework:spring-expression:5.3.12 (*)
| \--- org.springframework:spring-web:5.3.12 (*)
+--- org.springframework.boot:spring-boot-starter-webflux -> 2.5.6
| +--- org.springframework.boot:spring-boot-starter:2.5.6 (*)
| +--- org.springframework.boot:spring-boot-starter-json:2.5.6 (*)
| +--- org.springframework.boot:spring-boot-starter-reactor-netty:2.5.6
| | \--- io.projectreactor.netty:reactor-netty-http:1.0.12
| | +--- io.netty:netty-codec-http:4.1.69.Final
| | | +--- io.netty:netty-common:4.1.69.Final
| | | +--- io.netty:netty-buffer:4.1.69.Final
| | | | \--- io.netty:netty-common:4.1.69.Final
| | | +--- io.netty:netty-transport:4.1.69.Final
| | | | +--- io.netty:netty-common:4.1.69.Final
| | | | +--- io.netty:netty-buffer:4.1.69.Final (*)
| | | | \--- io.netty:netty-resolver:4.1.69.Final
| | | | \--- io.netty:netty-common:4.1.69.Final
| | | +--- io.netty:netty-codec:4.1.69.Final
| | | | +--- io.netty:netty-common:4.1.69.Final
| | | | +--- io.netty:netty-buffer:4.1.69.Final (*)
| | | | \--- io.netty:netty-transport:4.1.69.Final (*)
| | | \--- io.netty:netty-handler:4.1.69.Final
| | | +--- io.netty:netty-common:4.1.69.Final
| | | +--- io.netty:netty-resolver:4.1.69.Final (*)
| | | +--- io.netty:netty-buffer:4.1.69.Final (*)
| | | +--- io.netty:netty-transport:4.1.69.Final (*)
| | | \--- io.netty:netty-codec:4.1.69.Final (*)
| | +--- io.netty:netty-codec-http2:4.1.69.Final
| | | +--- io.netty:netty-common:4.1.69.Final
| | | +--- io.netty:netty-buffer:4.1.69.Final (*)
| | | +--- io.netty:netty-transport:4.1.69.Final (*)
| | | +--- io.netty:netty-codec:4.1.69.Final (*)
| | | +--- io.netty:netty-handler:4.1.69.Final (*)
| | | \--- io.netty:netty-codec-http:4.1.69.Final (*)
| | +--- io.netty:netty-resolver-dns:4.1.69.Final
| | | +--- io.netty:netty-common:4.1.69.Final
| | | +--- io.netty:netty-buffer:4.1.69.Final (*)
| | | +--- io.netty:netty-resolver:4.1.69.Final (*)
| | | +--- io.netty:netty-transport:4.1.69.Final (*)
| | | +--- io.netty:netty-codec:4.1.69.Final (*)
| | | +--- io.netty:netty-codec-dns:4.1.69.Final
| | | | +--- io.netty:netty-common:4.1.69.Final
| | | | +--- io.netty:netty-buffer:4.1.69.Final (*)
| | | | +--- io.netty:netty-transport:4.1.69.Final (*)
| | | | \--- io.netty:netty-codec:4.1.69.Final (*)
| | | \--- io.netty:netty-handler:4.1.69.Final (*)
| | +--- io.netty:netty-resolver-dns-native-macos:4.1.69.Final
| | | +--- io.netty:netty-common:4.1.69.Final
| | | +--- io.netty:netty-resolver-dns:4.1.69.Final (*)
| | | \--- io.netty:netty-transport-native-unix-common:4.1.69.Final
| | | +--- io.netty:netty-common:4.1.69.Final
| | | +--- io.netty:netty-buffer:4.1.69.Final (*)
| | | \--- io.netty:netty-transport:4.1.69.Final (*)
| | +--- io.netty:netty-transport-native-epoll:4.1.69.Final
| | | +--- io.netty:netty-common:4.1.69.Final
| | | +--- io.netty:netty-buffer:4.1.69.Final (*)
| | | +--- io.netty:netty-transport:4.1.69.Final (*)
| | | \--- io.netty:netty-transport-native-unix-common:4.1.69.Final (*)
| | +--- io.projectreactor.netty:reactor-netty-core:1.0.12
| | | +--- io.netty:netty-handler:4.1.69.Final (*)
| | | +--- io.netty:netty-handler-proxy:4.1.69.Final
| | | | +--- io.netty:netty-common:4.1.69.Final
| | | | +--- io.netty:netty-buffer:4.1.69.Final (*)
| | | | +--- io.netty:netty-transport:4.1.69.Final (*)
| | | | +--- io.netty:netty-codec:4.1.69.Final (*)
| | | | +--- io.netty:netty-codec-socks:4.1.69.Final
| | | | | +--- io.netty:netty-common:4.1.69.Final
| | | | | +--- io.netty:netty-buffer:4.1.69.Final (*)
| | | | | +--- io.netty:netty-transport:4.1.69.Final (*)
| | | | | \--- io.netty:netty-codec:4.1.69.Final (*)
| | | | \--- io.netty:netty-codec-http:4.1.69.Final (*)
| | | +--- io.netty:netty-resolver-dns:4.1.69.Final (*)
| | | +--- io.netty:netty-resolver-dns-native-macos:4.1.69.Final (*)
| | | +--- io.netty:netty-transport-native-epoll:4.1.69.Final (*)
| | | \--- io.projectreactor:reactor-core:3.4.11
| | | \--- org.reactivestreams:reactive-streams:1.0.3
| | \--- io.projectreactor:reactor-core:3.4.11 (*)
| +--- org.springframework:spring-web:5.3.12 (*)
| \--- org.springframework:spring-webflux:5.3.12
| +--- org.springframework:spring-beans:5.3.12 (*)
| +--- org.springframework:spring-core:5.3.12 (*)
| +--- org.springframework:spring-web:5.3.12 (*)
| \--- io.projectreactor:reactor-core:3.4.11 (*)
+--- org.springframework.boot:spring-boot-starter-data-jpa:2.5.3
| +--- org.springframework.boot:spring-boot-starter-aop:2.5.3 -> 2.5.6
| | +--- org.springframework.boot:spring-boot-starter:2.5.6 (*)
| | +--- org.springframework:spring-aop:5.3.12 (*)
| | \--- org.aspectj:aspectjweaver:1.9.7
| +--- org.springframework.boot:spring-boot-starter-jdbc:2.5.3 -> 2.5.6
| | +--- org.springframework.boot:spring-boot-starter:2.5.6 (*)
| | +--- com.zaxxer:HikariCP:4.0.3
| | | \--- org.slf4j:slf4j-api:1.7.30 -> 1.7.32
| | \--- org.springframework:spring-jdbc:5.3.12
| | +--- org.springframework:spring-beans:5.3.12 (*)
| | +--- org.springframework:spring-core:5.3.12 (*)
| | \--- org.springframework:spring-tx:5.3.12
| | +--- org.springframework:spring-beans:5.3.12 (*)
| | \--- org.springframework:spring-core:5.3.12 (*)
| +--- jakarta.transaction:jakarta.transaction-api:1.3.3
| +--- jakarta.persistence:jakarta.persistence-api:2.2.3
| +--- org.hibernate:hibernate-core:5.4.32.Final
| | +--- org.jboss.logging:jboss-logging:3.4.1.Final -> 3.4.2.Final
| | +--- org.javassist:javassist:3.27.0-GA
| | +--- net.bytebuddy:byte-buddy:1.10.22
| | +--- antlr:antlr:2.7.7
| | +--- org.jboss:jandex:2.2.3.Final
| | +--- com.fasterxml:classmate:1.5.1
| | +--- org.dom4j:dom4j:2.1.3
| | +--- org.hibernate.common:hibernate-commons-annotations:5.1.2.Final
| | | \--- org.jboss.logging:jboss-logging:3.3.2.Final -> 3.4.2.Final
| | \--- org.glassfish.jaxb:jaxb-runtime:2.3.1 -> 2.3.5
| | +--- jakarta.xml.bind:jakarta.xml.bind-api:2.3.3
| | +--- org.glassfish.jaxb:txw2:2.3.5
| | +--- com.sun.istack:istack-commons-runtime:3.0.12
| | \--- com.sun.activation:jakarta.activation:1.2.2
| +--- org.springframework.data:spring-data-jpa:2.5.3 -> 2.5.6
| | +--- org.springframework.data:spring-data-commons:2.5.6
| | | +--- org.springframework:spring-core:5.3.11 -> 5.3.12 (*)
| | | +--- org.springframework:spring-beans:5.3.11 -> 5.3.12 (*)
| | | \--- org.slf4j:slf4j-api:1.7.26 -> 1.7.32
| | +--- org.springframework:spring-orm:5.3.11 -> 5.3.12
| | | +--- org.springframework:spring-beans:5.3.12 (*)
| | | +--- org.springframework:spring-core:5.3.12 (*)
| | | +--- org.springframework:spring-jdbc:5.3.12 (*)
| | | \--- org.springframework:spring-tx:5.3.12 (*)
| | +--- org.springframework:spring-context:5.3.11 -> 5.3.12 (*)
| | +--- org.springframework:spring-aop:5.3.11 -> 5.3.12 (*)
| | +--- org.springframework:spring-tx:5.3.11 -> 5.3.12 (*)
| | +--- org.springframework:spring-beans:5.3.11 -> 5.3.12 (*)
| | +--- org.springframework:spring-core:5.3.11 -> 5.3.12 (*)
| | \--- org.slf4j:slf4j-api:1.7.26 -> 1.7.32
| \--- org.springframework:spring-aspects:5.3.9 -> 5.3.12
| \--- org.aspectj:aspectjweaver:1.9.7
+--- com.h2database:h2:2.0.202
+--- org.webjars:jquery:3.5.1
+--- org.webjars:bootstrap:4.5.0
| +--- org.webjars:jquery:3.5.1
| \--- org.webjars:popper.js:1.16.0
+--- org.thymeleaf:thymeleaf:3.0.12.RELEASE (*)
+--- org.xhtmlrenderer:flying-saucer-pdf-openpdf:9.1.20
| +--- com.github.librepdf:openpdf:1.3.11
| | \--- com.github.albfernandez:juniversalchardet:2.3.0
| \--- org.xhtmlrenderer:flying-saucer-core:9.1.20
+--- org.apache.commons:commons-csv:1.5
+--- com.opencsv:opencsv:5.2
| +--- org.apache.commons:commons-lang3:3.10 -> 3.12.0
| +--- org.apache.commons:commons-text:1.8
| | \--- org.apache.commons:commons-lang3:3.9 -> 3.12.0
| +--- commons-beanutils:commons-beanutils:1.9.4
| | +--- commons-logging:commons-logging:1.2
| | \--- commons-collections:commons-collections:3.2.2
| \--- org.apache.commons:commons-collections4:4.4
+--- org.apache.httpcomponents:httpclient:4.5.13
| +--- org.apache.httpcomponents:httpcore:4.4.13 -> 4.4.14
| +--- commons-logging:commons-logging:1.2
| \--- commons-codec:commons-codec:1.11 -> 1.10
+--- commons-codec:commons-codec:1.10
+--- commons-io:commons-io:2.11.0
+--- org.json:json:20210307
\--- com.googlecode.json-simple:json-simple:1.1.1
\--- junit:junit:4.10 -> 4.13.2
\--- org.hamcrest:hamcrest-core:1.3 -> 2.2
\--- org.hamcrest:hamcrest:2.2
(c) - dependency constraint
(*) - dependencies omitted (listed previously)
A web-based, searchable dependency report is available by adding the --scan option.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 9s
1 actionable task: 1 executed
Strangely if I uninstall gradle, I can see that the plugin picks up gradlew however the result is the same, nothing in the results pane.
That is strange @rpanman-sonatype.
Going to solicit some advice from @DarthHater before we make any changes.
I started some more in depth troubleshooting. It seems that parseGradleDependencyTree is called with includeDev set to true - parseGradleDependencyTree then looks for 'testRuntimeClasspath' as the start string for determining the list of depenencies. Since this string is not present in the gradle output then no dependencies are found. Next step is to work out why includeDev is set to true.
includeDev
is a feature that you can toggle in the plugin:
Do you want to try disabling that @rpanman-sonatype ?
Yes, that fixes it. So now I'm wondering why the gradle dependencies command is gradle dependencies --configuration runtimeClasspath
- shouldn't is use testRuntimeClasspath
rather than runtimeClasspath
?
:tada: This issue has been resolved in version 1.2.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Describe the bug When running a scan on a gradle project with dependencies in the gradle.build file, no dependencies are found and the VSCode IQ plugin returns no results.
To Reproduce Steps to reproduce the behavior:
git clone https://github.com/sonatype-nexus-community/nexusiq-successmetrics.git
Expected behavior VSCode IQ plugin finds the dependencies and presents those to the IQ server for analysis, the results are then displayed correctly in the "Sonatype Scan Results" section.
Screenshots Empty scan results:
Desktop (please complete the following information):
Additional context Detailed logs shows no dependencies found:
The gradle command above does return dependencies:
cc @bhamail / @DarthHater