antigenomics/vdjmatch

Broken build with Java 8

dbolotin opened this issue · 1 comments

When building using maven with Java 8, build fails with following error messages:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project vdjdb: Compilation failure: Compilation failure:
[ERROR] /Volumes/Data/Projects/MiLaboratory/vdjdb/src/main/groovy/com/antigenomics/vdjdb/core/db/CdrDatabase.groovy:[27,7] 1. ERROR in /Volumes/Data/Projects/MiLaboratory/vdjdb/src/main/groovy/com/antigenomics/vdjdb/core/db/CdrDatabase.groovy (at line 27)
[ERROR] class CdrDatabase implements Iterable<CdrEntrySet> {
[ERROR] ^^^^^^^^^^^
[ERROR] Groovy:Can't have an abstract method in a non-abstract class. The class 'com.antigenomics.vdjdb.core.db.CdrDatabase' must be declared abstract or the method 'void forEach(java.util.function.Consumer)' must be implemented.
[ERROR]
[ERROR] /Volumes/Data/Projects/MiLaboratory/vdjdb/src/main/groovy/com/antigenomics/vdjdb/core/db/CdrDatabase.groovy:[27,7] 2. ERROR in /Volumes/Data/Projects/MiLaboratory/vdjdb/src/main/groovy/com/antigenomics/vdjdb/core/db/CdrDatabase.groovy (at line 27)
[ERROR] class CdrDatabase implements Iterable<CdrEntrySet> {
[ERROR] ^^^^^^^^^^^
[ERROR] Groovy:Can't have an abstract method in a non-abstract class. The class 'com.antigenomics.vdjdb.core.db.CdrDatabase' must be declared abstract or the method 'java.util.Spliterator spliterator()' must be implemented.
[ERROR]
[ERROR] /Volumes/Data/Projects/MiLaboratory/vdjdb/src/main/groovy/com/antigenomics/vdjdb/core/db/CdrEntrySet.groovy:[6,7] 3. ERROR in /Volumes/Data/Projects/MiLaboratory/vdjdb/src/main/groovy/com/antigenomics/vdjdb/core/db/CdrEntrySet.groovy (at line 6)
[ERROR] class CdrEntrySet implements Iterable<CdrEntry> {
[ERROR] ^^^^^^^^^^^
[ERROR] Groovy:Can't have an abstract method in a non-abstract class. The class 'com.antigenomics.vdjdb.core.db.CdrEntrySet' must be declared abstract or the method 'void forEach(java.util.function.Consumer)' must be implemented.
[ERROR]
[ERROR] /Volumes/Data/Projects/MiLaboratory/vdjdb/src/main/groovy/com/antigenomics/vdjdb/core/db/CdrEntrySet.groovy:[6,7] 4. ERROR in /Volumes/Data/Projects/MiLaboratory/vdjdb/src/main/groovy/com/antigenomics/vdjdb/core/db/CdrEntrySet.groovy (at line 6)
[ERROR] class CdrEntrySet implements Iterable<CdrEntry> {
[ERROR] ^^^^^^^^^^^
[ERROR] Groovy:Can't have an abstract method in a non-abstract class. The class 'com.antigenomics.vdjdb.core.db.CdrEntrySet' must be declared abstract or the method 'java.util.Spliterator spliterator()' must be implemented.

I think the issue can be solved by upgrading groovy compiler (current seems to fail to understand Java 8 default methods in interfaces).

Not that simple. Changing groovy-eclipse-compiler from 1.7 to 1.8 will cause build to fail. gmaven-runtime-2.0 should not be used here, as it is causing problems. Under 1.7 it was used to ensure tests would be ran, however a simple fix for it with groovy-eclipse-compiler is to create a dummy java class in tests folder.