Java 8 and modules?

After upgrading to Java 8, I ran into an issue building some of the modules (with Powermock / javassist). I could fix it, but then I started thinking that modules will continue to be built on previous versions of Java in order to maintain backward compatibility.

So is the assumption that developers working on core 1.12 as well as modules (e.g. Hibernate upgrade) will be compiling the modules under Java 8 (and fixing incompatibilities)? Or is there a reason to continue compiling the modules under previous version of Java (which is the actual deployment use case)?

Many modules will continue to be compiled using JDK 6 by our CI as they need to support OpenMRS Platform 1.9+.

To ease development and eliminate the need to change between JDK 6 and JDK 8 all the time we should make modules compatible with JDK 8 compiler, but still using Java 6 target and source versions.

Regarding the Powermock issue, we recommend a different approach for mocking out services. Please see https://wiki.openmrs.org/display/docs/Mock+Doc