Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Compile error - wrong source folders are taken in a multi-module Maven project

Hello,

we are using the clover maven plugin 3.1.0 and we want to setup the clover reporting with our bamboo server.

Now we get a compile error during the clover2:setup phase: cannot find symbol symbol : class Foobar

We have a look into the project, which should hold the Foobar class. After looking at the jar file we do not found the Foobar class in it. the close2:setup has compiled the project but with the content of another project.



then I checkout the source file for the maven-clover2 plugin and add some extra output:

class CloverInstrumentInternalMojo {
...
    @Override
    public void execute() throws MojoExecutionException {
...
        System.out.println("1:" + getProject().getCompileSourceRoots());
        resetSrcDirsOriginal(getProject().getArtifact(), this);
        System.out.println("2:" + getProject().getCompileSourceRoots());

The output is:

1:[D:\Build\cmh.bamboo\compile-deploy\de.ponton.cmh.queuing.xp\src]
[DEBUG] Clover source directories before change:
[DEBUG] [Clover]  source root [D:\Build\cmh.bamboo\compile-deploy\de.ponton.cmh.queuing.xp\src]
[DEBUG] Clover main source directories after change:
[DEBUG] [Clover]  source root [D:\Build\cmh.bamboo\compile-deploy\de.ponton.cmh.auditlog.xp\src\main\java]
[DEBUG] Clover source directories before change:
[DEBUG] [Clover]  source root [D:\Build\cmh.bamboo\compile-deploy\de.ponton.cmh.queuing.xp\src\test\java]
[DEBUG] Clover main source directories after change:
[DEBUG] [Clover]  source root [D:\Build\cmh.bamboo\compile-deploy\de.ponton.cmh.queuing.xp\src\test\java]
2:[D:\Build\cmh.bamboo\compile-deploy\de.ponton.cmh.auditlog.xp\src\main\java]

Why is the plugin changing the source directory to a wrong one?

Regards, Jens

PS: sorry for the bad formatting but your editor drives my crazy.

2 answers

Hello,

I found the problem:

// HACK: this allows us to reset the source directories to the originals
private static Map originalSrcMap = new HashMap();
private static Map originalSrcTestMap = new HashMap();

This map contains the orginal source folder. We have two artifacts with the same artifact id but different group ids, therefore we got the worng source folder.

Regards, Jens

0 votes

This problem has been solved in Clover-for-Maven2&3 version 3.1.6 (bug CLOV-1026).

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Happy New Year and Welcome New Marketplace Partner Program Partners!

Happy New Year! We hope you all had a safe and restful holiday season. 2020 was a unique year full of unforeseen events; however, as we enter the new year of 2021, we’re optimistic for the light at t...

559 views 7 22
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you