I am trying to upgrade my application to Java 8, but it uses OpenJPA with build time enhancement through the openjpa-maven-plugin 2.3.0, which seems to be the last version.
When I build my application, I get an IllegalArgumentException because that version of the plugin is using a PCEnhancer that depends on org.apache.xbean.asm4.ClassReader, that is not compatible with Java 8. I found this ticket: https://issues.apache.org/jira/browse/OPENJPA-2386, but still it is not solved.
Do you know any other way to implement the build enhancement for openjpa without using the openjpa-maven-plugin?
As you pointed out, Java 8 with its additional syntax is not compatible with OpenJPA 2.3.0 class enhancement. However, if you absolutely need to use code with OpenJPA 2.3.0 which is written for the Java 8 standard library, you can still compile your code using a JDK for Java 8 which outputs Java version <8 bytecode. For example, I use this workaround in Maven:
POM:
settings.xml: