konveyor / rulesets

Collections of static code analysis rules
Apache License 2.0
1 stars 25 forks source link

Create rule for minimum usage of Java17 and JakartaEE 9+ #133

Open jmle opened 1 month ago

jmle commented 1 month ago

According to the migration guide:

Spring Framework 6.0 raises the minimum requirements to Java 17+ and Jakarta EE 9+.

This can be achieved:

In the rule description and message, try to be as verbose and clear as possible. Code examples are always welcome and useful. Feel free to use markdown syntax for these.

konveyor-ci-bot[bot] commented 1 month ago

This issue is currently awaiting triage. If contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance. The triage/accepted label can be added by org members.

jmle commented 1 month ago

We can assume here that we are migrating from Spring Framework 5 to 6, therefore we can look for the java.version property to check the version of Java being used. The property maven.compiler.source can also be checked in case it exists.

Knowing the Jakarta version being used can be trickier. We need to take a look at potential JavaEE/JakartaEE versions being imported. If any javax package is found, a rule should be triggered.