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

0 vote

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Marketplace Apps

Tips on how to choose the best estimation method for your planning

Planning and grooming sessions all come with their own sets of rules. Team members meet to estimate stories or other work items, all according to an agreed-upon process. And with every session comes ...

77 views 0 11
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