NPE when using the animal-sniffer enforcer rule

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

NPE when using the animal-sniffer enforcer rule

Jeffrey E Care
I'm kicking the tires on animal-sniffer & I've hit a problem with the enforcer rule. The stack trace is below.

In my tire kicker, I have a 1.0 module with a few classes, a 2.0 module with the same classes, containing both compatible & incompatible changes. The 1.0 module builds a signature file, the 2.0 module uses the enforcer rule to check that the 2.0 version of the API is compatible with the 1.0 signature file. I can zip up the whole thing and send it along if it would be helpful.

I pulled down the animal-sniffer code to investigate...it looks like SignatureChecker.java:268 is trying to do something with the source path; I couldn't see how the source path was being set in the enforcer rule...

Stack trace follows:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.2:enforce (check-api-signature) on project sniffer-test: Execution check-api-signature of goal org.apache.maven.plugins:maven-enforcer-plugin:1.2:enforce failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.2:enforce (check-api-signature) on project sniffer-test: Execution check-api-signature of goal org.apache.maven.plugins:maven-enforcer-plugin:1.2:enforce failed.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
        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:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution check-api-signature of goal org.apache.maven.plugins:maven-enforcer-plugin:1.2:enforce failed.
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: java.lang.NullPointerException
        at org.codehaus.mojo.animal_sniffer.SignatureChecker$CheckingVisitor.visitSource(SignatureChecker.java:268)
        at org.objectweb.asm.ClassReader.accept(Unknown Source)
        at org.objectweb.asm.ClassReader.accept(Unknown Source)
        at org.codehaus.mojo.animal_sniffer.SignatureChecker.process(SignatureChecker.java:156)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.processClassFile(ClassFileVisitor.java:178)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.process(ClassFileVisitor.java:103)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.process(ClassFileVisitor.java:83)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.processDirectory(ClassFileVisitor.java:121)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.process(ClassFileVisitor.java:99)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.process(ClassFileVisitor.java:83)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.processDirectory(ClassFileVisitor.java:121)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.process(ClassFileVisitor.java:99)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.process(ClassFileVisitor.java:83)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.processDirectory(ClassFileVisitor.java:121)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.process(ClassFileVisitor.java:99)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.process(ClassFileVisitor.java:83)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.processDirectory(ClassFileVisitor.java:121)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.process(ClassFileVisitor.java:99)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.process(ClassFileVisitor.java:83)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.processDirectory(ClassFileVisitor.java:121)
        at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.process(ClassFileVisitor.java:99)
        at org.codehaus.mojo.animal_sniffer.enforcer.CheckSignatureRule.execute(CheckSignatureRule.java:127)
        at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:178)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        ... 20 more


Jeffrey E. (Jeff) Care
Advisory Software Engineer | IBM Watson Solutions Release Engineering
email:
carej@... | External: 919-543-4907 | Tie line: 441-4907
FaceBook Twitter Button