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>
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.