I'm trying to get Clover 3.1.0 working with the new syntax available in Java 7. I've created a minimal pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"></p<>>
<modelVersion>4.0.0</modelVersion>
<groupId>clovertest</groupId>
<version>1</version>
<artifactId>clover</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-...
For the information of others, this is resolved in Clover 3.1.3. It was a problem relating to the creation of invalid Java code when instrumenting.
I'm having the same issue with 3.1.2 and very similar setup. It's interesting to note that the output claims 'processing with source 1.7', but then the compilation seems to change the source type to 1.6. I tried to have a look at the clover2 plugin for Maven, but apparently, it's source has been removed. http://docs.atlassian.com/maven-clover2-plugin/2.3.1/source-repository.html claims it should be in SVN, but the clover directory (https://svn.atlassian.com/svn/public/contrib/clover/) is empty, and browsing around didn't show anything.
Is Clover actively maintained at all? It's a bit scary that things seem to be so out of date with unanswered questions and links pointing into nowhere.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you please post the contents of CloverTest.java - both the original and the instrumented version found in src-instrumented\test?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've uploaded the project (pom.xml + CloverTest.java):
select File->Download Original.
I'm running on a clean Maven 3.0.3/Java 1.7.0 setup. With what I consider is the minimal pom to get the plugin working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The generated source look fine. But I guess somehow the plugin forgets to set source 1.7
----------------------Original-------------------
package test;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class CloverTest {
public static void main(String[] args) throws FileNotFoundException, IOException {
try (FileInputStream ff = new FileInputStream("foo")) {
}
}
}
Instrumented version here http://pastebin.com/pCpK6gtY
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
While JDK is specifically set to 1.7 (<jdk>1.7</jdk>) still experiencing the same issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Sergei: if you're using the latest Clover and still have instrumentation error, it might be related with a source file encoding - see <encoding> parameter for clover2:setup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.