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

exception thrown while generating maven site

ikshvak ikshvak February 26, 2014

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
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2014

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
TAGS
AUG Leaders

Atlassian Community Events