java8 のデフォルト メソッド宣言を使用してインターフェイスを宣言しました。
public interface MyInterface {
default String myMethod(String str) {
//IMPLEMENTATION
}
}
次に、Maven ゴールを実行しました。
mvn cobertura:cobertura
cobertura は java8 のデフォルト メソッド宣言をサポートしていないため、ログにエラーが表示されます。
[INFO] Executed tasks
[INFO]
[INFO] <<< cobertura-maven-plugin:2.7:cobertura (default-cli) < [cobertura]test @ extractor <<<
[INFO]
[INFO] --- cobertura-maven-plugin:2.7:cobertura (default-cli) @ extractor ---
[INFO] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[INFO] Cobertura: Loaded information on 134 classes.
[WARN] JavaNCSS got an error while parsing the java file <PATH_TO_MY_INTERFACE>\MyInterface.java
ParseException in STDIN
Last useful checkpoint: "path.to.my.class.MyInterface"
Encountered " "default" "default "" at line 10, column 9.
Was expecting one of:
"abstract" ...
"boolean" ...
"byte" ...
"char" ...
"class" ...
"double" ...
"enum" ...
"final" ...
"float" ...
"int" ...
"interface" ...
"long" ...
"native" ...
"private" ...
"protected" ...
"public" ...
"short" ...
"static" ...
"strictfp" ...
"synchronized" ...
"transient" ...
"void" ...
"volatile" ...
<IDENTIFIER> ...
"}" ...
";" ...
"@" ...
"<" ...
どうすれば修正できますか?