Various problems using checker from Maven

75 views
Skip to first unread message

Mike Hearn

unread,
Feb 7, 2015, 4:37:03 PM2/7/15
to checker-fram...@googlegroups.com
Hi there,

Firstly - love what you guys are doing, this sort of practical, incremental type system is going to be super useful!

That said ..... I've been having a devil of a time getting Checker to actually work with a simple hello world project with Maven, and as far as I can tell all the pain is due to the use of the custom javac program.  I eventually got it to work with the units checker (no @ms annotation? millisecs seem like the most common unit you'd want!) ... but trying to use the IGJ checker results in this error. If I run javac_maven outside of maven, then it works OK.

Any idea what might cause this? Maven must be doing something more complicated than a fork/exec() pair.

As an aside, when using 8u40 is there any way to use the regular javac from the JDK and just specify the annotation processor? Or is the Checker javac more than just a wrapper around the annotation processor loading process + support for commented out annotations? I ask because IntelliJ doesn't know how to use anything other than the normal javac+configurable annotations processors, you cannot tell it to use any arbitrary executable. There's an IntelliJ plugin but it seems to be broken :(

[ERROR] error: InvocationTargetException when invoking constructor for class org.checkerframework.checker.igj.IGJVisitor; Underlying cause: InvocationTargetException when invoking constructor for class org.checkerframework.checker.igj.IGJAnnotatedTypeFactory; Underlying cause: java.lang.AssertionError: Loading annotation "interface org.checkerframework.checker.igj.IGJBottom" failed!
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project kotlin-demo: Compilation failure
error: InvocationTargetException when invoking constructor for class org.checkerframework.checker.igj.IGJVisitor; Underlying cause: InvocationTargetException when invoking constructor for class org.checkerframework.checker.igj.IGJAnnotatedTypeFactory; Underlying cause: java.lang.AssertionError: Loading annotation "interface org.checkerframework.checker.igj.IGJBottom" failed!

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
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:497)
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.CompilationFailureException: Compilation failure
error: InvocationTargetException when invoking constructor for class org.checkerframework.checker.igj.IGJVisitor; Underlying cause: InvocationTargetException when invoking constructor for class org.checkerframework.checker.igj.IGJAnnotatedTypeFactory; Underlying cause: java.lang.AssertionError: Loading annotation "interface org.checkerframework.checker.igj.IGJBottom" failed!

at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:729)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more

Reply all
Reply to author
Forward
0 new messages