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

org.checkerframework:checker-compat-qual appears unused in many modules #3006

Closed
stevie400 opened this issue Dec 6, 2017 · 8 comments
Closed

Comments

@stevie400
Copy link

org.checkerframework:checker-compat-qual appears to be unused under both the jre and android flavors of guava and guava-tests but is listed as a dependency in those poms.

The org.checkerframework:checker-compat-qual:2.0.0 jar contains .class files with either org.checkerframework or afu.plume in their packages. I see the following, which makes me think this is safe to remove this dependency from the above modules:

$ grep -r -l "afu.plume" .
$ grep -r -l "org.checkerframework" .
./android/guava/pom.xml
./android/guava-testlib/pom.xml
./android/guava-testlib/src/com/google/common/testing/ArbitraryInstances.java
./android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java
./android/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java
./android/guava-testlib/src/com/google/common/testing/NullPointerTester.java
./android/guava-testlib/src/com/google/common/testing/TestLogHandler.java
./android/guava-testlib/test/com/google/common/testing/ClassSanityTesterTest.java
./android/guava-testlib/test/com/google/common/testing/NullPointerTesterTest.java
./android/guava-tests/pom.xml
./android/pom.xml
./guava/pom.xml
./guava-testlib/pom.xml
./guava-testlib/src/com/google/common/testing/ArbitraryInstances.java
./guava-testlib/src/com/google/common/testing/ClassSanityTester.java
./guava-testlib/src/com/google/common/testing/CollectorTester.java
./guava-testlib/src/com/google/common/testing/FreshValueGenerator.java
./guava-testlib/src/com/google/common/testing/NullPointerTester.java
./guava-testlib/src/com/google/common/testing/TestLogHandler.java
./guava-testlib/test/com/google/common/testing/ClassSanityTesterTest.java
./guava-testlib/test/com/google/common/testing/NullPointerTesterTest.java
./guava-tests/pom.xml
./pom.xml

I came across this because our in-house maven plugins were failing to compile after upgrading to 23.5-jre and excluding org.checkerframework:checker-compat-qual from guava seemed to fix the issue. An example build failure is:

[INFO] --- maven-plugin-plugin:3.4:descriptor (default-descriptor) @ config-maven-plugin ---
[INFO] Using 'UTF-8' encoding to read mojo metadata.
[INFO] Mojo extractor with id: java-javadoc found 0 mojo descriptors.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.716 s
[INFO] Finished at: 2017-12-05T15:48:25Z
[INFO] Final Memory: 50M/478M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.4:descriptor (default-descriptor) on project config-maven-plugin: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.4:descriptor failed. RuntimeException -> [Help 1]
@cpovirk
Copy link
Member

cpovirk commented Dec 7, 2017

This is intentional. We noted in the release notes that we added this dependency without using it, but we didn't explicitly call out that we intend to use it in the next release. I'll note that now.

@cpovirk cpovirk closed this as completed Dec 7, 2017
@cpovirk
Copy link
Member

cpovirk commented Dec 7, 2017

Sorry, posted too early. More in a moment.

@cpovirk cpovirk reopened this Dec 7, 2017
@cpovirk
Copy link
Member

cpovirk commented Dec 7, 2017

Sorry that it's breaking your build. I initially thought you were saying that your build was failing specifically because it was detecting an unused dependency, but that doesn't seem to be the problem. But I'm not sure what the problem is. Are there other ERROR lines in your log?

@stevie400
Copy link
Author

Unfortunately the failure is pretty inscrutable. It's not happening on our OSS plugins so there must be some internal Maven configuration we're doing that's messing with it.

Here's the stacktrace from running maven with -e:

[INFO] --- maven-plugin-plugin:3.4:descriptor (default-descriptor) @ config-maven-plugin ---
[INFO] Using 'UTF-8' encoding to read mojo metadata.
[INFO] Mojo extractor with id: java-javadoc found 0 mojo descriptors.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.323 s
[INFO] Finished at: 2017-12-07T14:47:26-05:00
[INFO] Final Memory: 55M/542M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.4:descriptor (default-descriptor) on project config-maven-plugin: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.4:descriptor failed.: RuntimeException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.4:descriptor (default-descriptor) on project config-maven-plugin: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.4:descriptor failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.4:descriptor failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:145)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.RuntimeException
    at org.objectweb.asm.FieldVisitor.visitTypeAnnotation (Unknown Source)
    at org.objectweb.asm.ClassReader.a (Unknown Source)
    at org.objectweb.asm.ClassReader.accept (Unknown Source)
    at org.objectweb.asm.ClassReader.accept (Unknown Source)
    at org.apache.maven.tools.plugin.extractor.annotations.scanner.DefaultMojoAnnotationsScanner.analyzeClassStream (DefaultMojoAnnotationsScanner.java:202)
    at org.apache.maven.tools.plugin.extractor.annotations.scanner.DefaultMojoAnnotationsScanner.scanArchive (DefaultMojoAnnotationsScanner.java:139)
    at org.apache.maven.tools.plugin.extractor.annotations.scanner.DefaultMojoAnnotationsScanner.scan (DefaultMojoAnnotationsScanner.java:108)
    at org.apache.maven.tools.plugin.extractor.annotations.scanner.DefaultMojoAnnotationsScanner.scan (DefaultMojoAnnotationsScanner.java:75)
    at org.apache.maven.tools.plugin.extractor.annotations.JavaAnnotationsMojoDescriptorExtractor.scanAnnotations (JavaAnnotationsMojoDescriptorExtractor.java:124)
    at org.apache.maven.tools.plugin.extractor.annotations.JavaAnnotationsMojoDescriptorExtractor.execute (JavaAnnotationsMojoDescriptorExtractor.java:103)
    at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor (DefaultMojoScanner.java:96)
    at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute (AbstractGeneratorMojo.java:245)
    at org.apache.maven.plugin.plugin.DescriptorGeneratorMojo.execute (DescriptorGeneratorMojo.java:90)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

@cpovirk
Copy link
Member

cpovirk commented Dec 7, 2017

Maybe try upgrading to maven-plugin-plugin 3.5? Sounds like maybe this bug, which is supposedly fixed there.

@jhaber
Copy link

jhaber commented Dec 7, 2017

That does seem to be the issue, I pushed a reproducible example here. If you clone and run mvn clean verify it fails. But either downgrading Guava by doing mvn clean verify -Ddep.guava.version=23.2-jre or upgrading the maven-plugin-plugin by doing mvn clean verify -Ddep.plugin.plugin.version=3.5 seem to make it pass. Now that we know the issue it's easy enough to fix on our end, but might be worth a mention in the 23.5 release notes?

@cpovirk
Copy link
Member

cpovirk commented Dec 7, 2017

Good call. Done.

@cpovirk cpovirk closed this as completed Dec 7, 2017
@stevie400
Copy link
Author

Thanks for your help, Chris!

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

No branches or pull requests

4 participants