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 votes

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
Community showcase
Posted Tuesday in Featured Groups

Tuesday tips & tricks: What is the Atlassian Community?

It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...

78 views 3 6
View post

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