Comments (8)
Could you tell us which kind of failure it has? Is it not reasonable (e.g. generated code by JavaCC really has problem)?
from spotbugs-gradle-plugin.
It fails after hundreds of errors. Things like: "error: package pcgen.base.util does not exist"
...which is complaining about "import pcgen.base.util.TypedKey;"
The thing is, these are very real packages, and as I stated above, this all compiles without SpotBugs enabled.
This code has run well for a long time... over 100 versions over years. Those packages and classes the compileJavaccJava task are complaining about are very real in a JAR library. So these are configuration issues, not real code issues.
What is so baffling to me is that solely adding the spotbugs id line to build.gradle triggers this new task (and I can't find any documentation of what that task is or does) and thus leads to this set of failures.
So:
- Is the compileJavaccJava task actually added by SpotBugs or is there some other side effect of adding SpotBugs that is unclear?
- What is compileJavaccJava doing that is needed?
- Does this new task try to compile code assuming it has no dependencies? If so, that is a problem...
- Why is compileJavaccJava not drawing on known information, such as the "compile group" dependencies?
from spotbugs-gradle-plugin.
If you think generated code is working well, you don't care this problem so heavily. I recommend you to simply exclude generated classes from the target for SpotBugs.
I feel it's one of common patterns that generated code has problem (e.g. Lombok generates logger variable w/ bad naming) and static analysis needs to ignore them.
from spotbugs-gradle-plugin.
Is the compileJavaccJava task actually added by SpotBugs or is there some other side effect of adding SpotBugs that is unclear?
What is compileJavaccJava doing that is needed?
compileJavaccJava
is not added by SpotBugs, but added by gradle java plugin.
Does this new task try to compile code assuming it has no dependencies? If so, that is a problem...
It depends on your config. Use auxClasspath to provide path of dependencies.
from spotbugs-gradle-plugin.
If you think generated code is working well, you don't care this problem so heavily. I recommend you to simply exclude generated classes from the target for SpotBugs.
I'm still not sure we are discussing the same problem.
I am ignoring the generated code. The code which is triggering the error isn't generated code. I already have a suppressions.xml that ignores the generated code:
compileJavaccJava is not added by SpotBugs, but added by gradle java plugin.
...but where I'm confused is that Spotbugs is causing it to run. When I do a dry run without the id line for spotbugs, I get this:
:compileJjtree SKIPPED
:compileJavacc SKIPPED
:compileJava SKIPPED
:processResources SKIPPED
:classes SKIPPED
:jar SKIPPED
:assemble SKIPPED
:compileTestJava SKIPPED
:processTestResources SKIPPED
:testClasses SKIPPED
:test SKIPPED
:check SKIPPED
:build SKIPPED
When I do it with the id line for spotbugs added, I get this:
:compileJjtree SKIPPED
:compileJavacc SKIPPED
:compileJava SKIPPED
:processResources SKIPPED
:classes SKIPPED
:jar SKIPPED
:assemble SKIPPED
:compileJavaccJava SKIPPED
:processJavaccResources SKIPPED
:javaccClasses SKIPPED
:spotbugsJavacc SKIPPED
:spotbugsMain SKIPPED
:compileTestJava SKIPPED
:processTestResources SKIPPED
:testClasses SKIPPED
:spotbugsTest SKIPPED
:test SKIPPED
:check SKIPPED
:build SKIPPED
... so SpotBugs has added a number of steps (bolded), some of which are related to Javacc that are not necessary to the original build. I'm at a loss for why these were added?
from spotbugs-gradle-plugin.
adding "-x spotbugsJavacc" to my gradle command line at least gets me a workaround.
I'm still interested to know if there is a behavior/structure related to how Javacc and gradle are used that SpotBugs is expecting and not seeing in our setup.
from spotbugs-gradle-plugin.
wmm, strange... I'm sure that the tasks with spotbugs
prefix are generated by spotbugs-gradle-plugin,
But following three tasks should come from other place.
:compileJavaccJava SKIPPED
:processJavaccResources SKIPPED
:javaccClasses SKIPPED
I guess they are java plugin's sourceSet tasks.
from spotbugs-gradle-plugin.
I'll close this inactive issue. If you could reproduce this with the latest release, please feel free to reopen.
from spotbugs-gradle-plugin.
Related Issues (20)
- new false positive alert since version '5.2.0' HOT 3
- silence spotbugs warnings HOT 3
- java.lang.NoSuchMethodError: 'org.apache.commons.lang3.Range org.apache.commons.lang3.Range.of(java.lang.Comparable, java.lang.Comparable)' HOT 1
- SpotBugs using wrong Java SDK in Android Studio HOT 4
- plugin should add a space character when displaying failed report files HOT 2
- External stylesheet not used when defined in external gradle file HOT 3
- Replace depreated `BaseVariant` usages
- A failure occurred while executing com.github.spotbugs.snom.internal.SpotBugsRunnerForWorker$SpotBugsExecutor HOT 4
- Plugin does not run on JDK8 HOT 1
- Reports not created for cached task HOT 2
- Groovy valueOf(String) for effort and reportLevel not working HOT 2
- Reports not being created HOT 1
- Configuration Cache compatibilities
- Spotbugs fails to run appropriately when space is present in project path
- GHA Build issues Windows
- How to disable an specific check across the entire project? HOT 1
- Spotbug task fails on CI with error "java.io.IOException: error=7, Argument list too long" HOT 5
- Configurations for effort and reportLevel are broken. HOT 14
- Dependency Dashboard
- Spotbugs plugin for gradle 6.0.0-beta4 is broken in Netbeans 19 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spotbugs-gradle-plugin.