Compile error: com_atlassian_clover.TestNameSniffer cannot be resolved

One of the source won't compile.

From Maven Build

build 05-Aug-2014 07:39:12 [ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.4:compile (default) on project webServices: Compiler errors:
build 05-Aug-2014 07:39:12 [ERROR] error at (no source information available)
build 05-Aug-2014 07:39:12 [ERROR] /opt/atlassian/apps/bamboo-agent3/xml-data/build-dir/CP-SEI-JOB1/webServices/src/main/java/se/service/NotificationServiceImpl.java:1:0::0 The type com_atlassian_clover.TestNameSniffer cannot be resolved. It is indirectly referenced from required .class files
build 05-Aug-2014 07:39:12 [ERROR] -> [Help 1]
build 05-Aug-2014 07:39:12 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.4:compile (default) on project webServices: Compiler errors:
build 05-Aug-2014 07:39:12 error at (no source information available)
build 05-Aug-2014 07:39:12 /opt/atlassian/apps/bamboo-agent3/xml-data/build-dir/CP-SEI-JOB1/webServices/src/main/java/se/service/NotificationServiceImpl.java:1:0::0 The type com_atlassian_clover.TestNameSniffer cannot be resolved. It is indirectly referenced from required .class files
build 05-Aug-2014 07:39:12 
build 05-Aug-2014 07:39:12  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
build 05-Aug-2014 07:39:12  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
build 05-Aug-2014 07:39:12  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
build 05-Aug-2014 07:39:12  at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
build 05-Aug-2014 07:39:12  at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
build 05-Aug-2014 07:39:12  at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
build 05-Aug-2014 07:39:12  at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
build 05-Aug-2014 07:39:12  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
build 05-Aug-2014 07:39:12  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
build 05-Aug-2014 07:39:12  at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
build 05-Aug-2014 07:39:12  at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
build 05-Aug-2014 07:39:12  at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
build 05-Aug-2014 07:39:12  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
build 05-Aug-2014 07:39:12  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
build 05-Aug-2014 07:39:12  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
build 05-Aug-2014 07:39:12  at java.lang.reflect.Method.invoke(Method.java:597)
build 05-Aug-2014 07:39:12  at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
build 05-Aug-2014 07:39:12  at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
build 05-Aug-2014 07:39:12  at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
build 05-Aug-2014 07:39:12  at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
build 05-Aug-2014 07:39:12 Caused by: org.codehaus.mojo.aspectj.CompilationFailedException: Compiler errors:
build 05-Aug-2014 07:39:12 error at (no source information available)
build 05-Aug-2014 07:39:12 /opt/atlassian/apps/bamboo-agent3/xml-data/build-dir/CP-SEI-JOB1/webServices/src/main/java/se/service/NotificationServiceImpl.java:1:0::0 The type com_atlassian_clover.TestNameSniffer cannot be resolved. It is indirectly referenced from required .class files
build 05-Aug-2014 07:39:12 
build 05-Aug-2014 07:39:12  at org.codehaus.mojo.aspectj.AbstractAjcCompiler.execute(AbstractAjcCompiler.java:411)
build 05-Aug-2014 07:39:12  at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
build 05-Aug-2014 07:39:12  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
build 05-Aug-2014 07:39:12  ... 19 more
build 05-Aug-2014 07:39:12 [ERROR]

The type com_atlassian_clover.TestNameSniffer cannot be resolved. It is indirectly referenced from required .class files. Any idea? I have tried CLOVER:OFF the entire class but that didn't help.

Thanks.

1 answer

0 votes

Have you performed an upgrade from Clover 3.x to Clover 4.x recently?

If yes, then please check if you have changed the artifact name from com.cenqua.clover:clover to com.atlassian.clover:clover in a pom.xml.

See https://confluence.atlassian.com/display/CLOVER/Clover+4.0+Release+Notesfor more upgrade instructions.

Do you have a multi-module Maven project which is being built by Bamboo with an 'Automatically integrate Clover' option?

If yes, then you may have just hit this issue: https://jira.atlassian.com/browse/BAM-13208

Did you use the clover2:setup together with the 'install' or 'deploy' goal in a current or previous builds?

If yes, then the most probably your ~\.m2 Maven cache (or Maven repository) contains instrumented JAR files and you're trying to peform a build without Clover, but using these instrumented JARs.

Marek, I am facing the same issue when I am trying to run the instrumented classes/jar files from commandline. Like a simple java program. I am expecting the coverage.db file being updated with coverage info. 

When i try to open one of the insrumented class, its saying 

[CLOVER] WARNING: The Clover version used in instrumentation does not match the runtime version. You need to run instrumented classes against the same version of Clover that you instrumented with.

Basically i have mentioned class path for compile version only, where to mention the runtime version.

Have you added clover.jar to the classpath ? Since it's instrumented sources, there will be some Clover commands which depend on Clover library. 

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Feb 15, 2018 in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

1,085 views 6 19
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot