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

[java] Resolve dependencies of :pmd > Resolve dependencies of :detachedConfiguration78 #3134

Closed
nicoabie opened this issue Feb 24, 2021 · 5 comments
Labels
a:bug PMD crashes or fails to analyse a file. needs:user-input Maintainers are waiting for feedback from author was:unreproducible A bug report that cannot be reproduced - reporter should provide a MWE

Comments

@nicoabie
Copy link

nicoabie commented Feb 24, 2021

Affects PMD Version:
From 6.22.0 onwards

Description:

Everytime pmd is executed that dependency must be resolved and it takes 3mins

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
gradle
jdk 11.0.2

@nicoabie nicoabie added the a:bug PMD crashes or fails to analyse a file. label Feb 24, 2021
@adangel
Copy link
Member

adangel commented Feb 25, 2021

Thanks for the report. Can you give a bit more information on this issue? PMD uses maven as a build tool, so, I assume, you are using the gradle pmd plugin.

Gradle is developed over there -> https://github.com/gradle/gradle

If you can give us the information, which dependency is creating you difficulty, we can see, whether PMD brings in this dependency (then we can fix it here) or gradle (then it need to be fixed there).

A output from your build would also be helpful.

@nicoabie
Copy link
Author

Thanks for the quick response! The dependency that is bringing problems is detachedConfiguration78 I would try to post here the stack trace or some more info.

@adangel
Copy link
Member

adangel commented Mar 4, 2021

Without more info, we can't help you.
Most important would be: Which version of gradle are you using? Did you try to use the latest gradle version?
Can you share your build.gradle files?
Which build plugins besides "pmd" are you using?
How many dependencies do you have?
Do you use subprojects?

About detachedConfiguration, I found these threads:

As far as I understand, detachedConfiguration has to do with temporary dependency resolution for tasks/extensions.
The PMD gradle plugin deals with two classpaths:

  1. the classpath to execute PMD itself - configurable via toolVersion (https://github.com/gradle/gradle/blob/98a186f3ed7c4f629608d236ab31ddef442c9293/subprojects/code-quality/src/main/groovy/org/gradle/api/plugins/quality/PmdPlugin.java#L96-L103). This is named "pmdClasspath".
  2. the classpath of the project, needed as auxiliary classpath, named "classpath" in gradle and "auxclasspath" in ant/PMD: https://github.com/gradle/gradle/blob/master/subprojects/code-quality/src/main/groovy/org/gradle/api/plugins/quality/PmdPlugin.java#L145-L151

I guess, at both places, dependency resolution could take place. The second usage uses you project's compile classpath, which means the classpath of your project is maybe once again resolved for PMD. If your dependency resolution anyway takes much time, then it will double if you add the PMD plugin, because then gradle does the same work twice (so far as I understand it. With a newer version of gradle, that could be already optimized).

@nicoabie
Copy link
Author

nicoabie commented Mar 4, 2021

Thanks Andreas, as soon as I have time I would check on that, unfortunately I don't have build errors or a stack trace to share here but I will take the time to read those topics you provided!


Gradle 6.7

Build time: 2020-10-14 16:13:12 UTC
Revision: 312ba9e0f4f8a02d01854d1ed743b79ed996dfd3

Kotlin: 1.3.72
Groovy: 2.5.12
Ant: Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM: 11.0.2 (Oracle Corporation 11.0.2+9)
OS: Mac OS X 10.15.7 x86_64

@oowekyala oowekyala added the needs:user-input Maintainers are waiting for feedback from author label Feb 12, 2022
@adangel adangel added the was:unreproducible A bug report that cannot be reproduced - reporter should provide a MWE label Jan 24, 2023
@adangel
Copy link
Member

adangel commented Jan 24, 2023

Closing this as not reproducible. If you have more information, feel free to comment.

@adangel adangel closed this as not planned Won't fix, can't repro, duplicate, stale Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug PMD crashes or fails to analyse a file. needs:user-input Maintainers are waiting for feedback from author was:unreproducible A bug report that cannot be reproduced - reporter should provide a MWE
Projects
None yet
Development

No branches or pull requests

3 participants