Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.5k
-
Hello! Let me introduce my problem: I have a simple
So, each build.gradle looks like: A module:
B module:
C module:
When I run I got an issue:
Let me highlightthere is no any code used from module A in module B. Module Why does it work so? I thought PMD checks only transitive dependencies. I mean if there was some usage of class Could you please help me in that question? |
BetaWas this translation helpful?Give feedback.
All reactions
Hi! A number of things to note here…
As you would expect, PMD's analysis itself will only load classes as they are needed / referenced. In order to do so, PMD needs to be run with references to the wholeruntime classpath. It even looks at the JRE.
However, this error is not being triggered by the PMD analysis trying to load those classes!
This is Gradle failing to resolve a gradle configuration for a task that is part of the Grade binary itself. At this point in Gradle's execution PMD has not yet even been initialized. This is intended to ensure thatwhen PMD is actually run, the whole runtime classpath is available. If your code doesn't use a class PMD will not try to load it during ana…
Replies: 2 comments 2 replies
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Hi! A number of things to note here… As you would expect, PMD's analysis itself will only load classes as they are needed / referenced. In order to do so, PMD needs to be run with references to the wholeruntime classpath. It even looks at the JRE. However, this error is not being triggered by the PMD analysis trying to load those classes! This is Gradle failing to resolve a gradle configuration for a task that is part of the Grade binary itself. At this point in Gradle's execution PMD has not yet even been initialized. This is intended to ensure thatwhen PMD is actually run, the whole runtime classpath is available. If your code doesn't use a class PMD will not try to load it during analysis, however that doesn't stop Gradle from trying to ensure PMD has available "everything it may need" before it runs. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hello! Thank you so much for your answer Maybe there is a way to exclude spring-boot from class path of ‘pmdMain’ task but I am not sure it’s good practice for that resolution My concern is that this module B was supposed to be simple java module and I am really confused by this issue because of that |
BetaWas this translation helpful?Give feedback.
All reactions
-
To be honest, I don't know why this is failing. If project A can resolve the dependency from maven central, B should be able to do so too transitively (ie: to produce a fat jar)… but I don't know what those spring gradle plugins may be doing under the hood… |
BetaWas this translation helpful?Give feedback.
All reactions
-
I think you should report this problem to the gradle team as they are maintaining the pmd plugin |
BetaWas this translation helpful?Give feedback.