I'm in the process of upgrading a huge system with 3000+ java maven projects and repos deployed as a monolith war from Java 7 to 8. We will try to migrate parts of the system at a time, meaning some artifact will be built with jdk7 and some jdk8.
The question is; Is there a way (maven plugin or something) to enforce (fail the build) when artifacts built with jdk7 depend on jdk8 artifacts. The reverse (jdk8 -> jdk7) is allowed and also jdk8 -> jdk8. I don't think any of the built in rules in the maven enforcer plugin does this, and it might be difficult and time consuming to do?
Hope I'm being clear. Any suggestions?
Thanks!
As the original answer is gone, let me write it again with more details.
You can use the extra enforcer rule
http://www.mojohaus.org/extra-enforcer-rules/enforceBytecodeVersion.html
You configure this plugin to use at most JDK 1.7 (with the maxJdkVersion property) in all your projects. Then you disable the check for all projects you have already migrated to Java 8.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With