wttech / AEM-Rules-for-SonarQube

SonarQube plugin with set of rules detecting possible bugs and bad smells specific for AEM development.
Apache License 2.0
112 stars 51 forks source link

Bring back compatibility with Java 8. Fixes #201. #204

Closed raspy closed 3 years ago

raspy commented 3 years ago

Plugin code executes within SonarScanner, which still supports Java 8. As the plugin cannot be deactivated per project, current requirement to use Java 11 renders any project that still uses Java 8 or Java 9 (think: Android projects) can no longer be analyzed on the SQ server that has aemrules installed.

It seems however that the main refactoring made when the plugin was migrated to Java 11 was to remove guava dependencies. Luckily enough all current code can be slightly modified to use pure Java 8 statements, hence dropping dependency on guava while remaining compatible with Java 8 (and SonarScanner).

Please consider including the changes in the official release and release through the marketplace.

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.9%) to 94.665% when pulling 0330fda3795d55695e3f0709308039452e3dc618 on MotorolaSolutions:issue-201/compatibility-with-java-8 into fe48d830526621024479dc5568a8444989569b31 on Cognifide:master.

raspy commented 3 years ago

@toniedzwiedz would you please help to review and include the changes in a release? It seems that there have been people impacted by #201 (including myself).

toniedzwiedz commented 3 years ago

Hi @raspy, thanks for the PR. I've had a cursory look at the code changes and they seem fine. Please also revert this commit https://github.com/Cognifide/AEM-Rules-for-SonarQube/commit/efc963d431ef1c870bdb9fc1c4600b236e085644 in your branch to ensure Travis also builds the project with JDK 8 (which should be possible if we use this source level).

raspy commented 3 years ago

Reverted as requested, seems to work with Travis as well.

toniedzwiedz commented 3 years ago

@raspy it does, thanks. I'll kick off a release today.