exception thrown while generating maven site

I am having my compiler plugin at java 1.4 where as clover plugin at 1.6. Installation and deployment works fine but I am using while generating site. This exception is thrown:

(use-source 5or higher to enable annotations)@SuppressWarnings({"fallthrough"})publicclassTestClass

My code has no annotation and is just 1.4 comptaible but site isn't working. Any workaround or am I doing something wrong??

plugins:

<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<version>
3.0.5</version>
<configuration>
<includesTestSourceRoots>false</includesTestSourceRoots>
<includesAllSourceRoots>
false</includesAllSourceRoots>
<jdk>1.6</jdk>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<phase>pre-site</phase>
<goals>
<goal>instrument</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<source>${project.java.version}</source>
<target>${project.java.version}</target>
</configuration>
</execution>
<execution>
<id>default-testCompile</id>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</execution>
</executions>
</plugin>

1 answer

This widget could not be displayed.

As you wrote, you are using <jdk>1.6</jdk> for Clover. Therefore, Clover has generated a code with @SuppressWarnings("fallthrough") annotation, which is perfectly fine for JDK6.

I suggest configuring your build in such way, that when build is performed with Clover, both main and test code will be compiled with <source> and <target> 1.6.

You can use a profile, for instance.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

129 views 16 7
Join discussion

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