diff --git a/.github/actions/test-plugin-installation/run-tests.sh b/.github/actions/test-plugin-installation/run-tests.sh index 7972913..8ef5dc6 100755 --- a/.github/actions/test-plugin-installation/run-tests.sh +++ b/.github/actions/test-plugin-installation/run-tests.sh @@ -3,7 +3,7 @@ # #%L # AEM Rules for SonarQube # %% -# Copyright (C) 2015-2019 Wunderman Thompson Technology +# Copyright (C) 2015-2024 VML # %% # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/test-instalation.yml b/.github/workflows/test-instalation.yml index bf8a742..2690dfe 100644 --- a/.github/workflows/test-instalation.yml +++ b/.github/workflows/test-instalation.yml @@ -2,7 +2,7 @@ # #%L # AEM Rules for SonarQube # %% -# Copyright (C) 2015-2019 Wunderman Thompson Technology +# Copyright (C) 2015-2024 VML # %% # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 16d0506..467fb81 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ -[![Wunderman Thompson Technology logo](assets/vml-logo.png)](http://www.cognifide.com/) +[](http://www.vml.com/poland) -![Builds Status](https://github.com/wttech/AEM-Rules-for-SonarQube/actions/workflows/build.yml/badge.svg) + +![Builds Status](https://github.com/wttech/AEM-Rules-for-SonarQube/actions/workflows/build.yml/badge.svg) [Available in SonarCloud](https://sonarcloud.io) +[Available in SonarQube](https://www.sonarqube.org/) # About AEM Rules for SonarQube ![AEM Rules for SonarQube](https://raw.githubusercontent.com/wttech/AEM-Rules-for-SonarQube/master/assets/logo.png) ## Purpose -As we all know, SonarQube is a great tool that helps us increase quality of our codebase. However, it does apply mainly to general Java issues. As we know, we can hurt ourselves much more doing AEM. [Adobe Experience Manager](https://docs.adobe.com/docs/en/aem/6-2.html) is a comprehensive content management platform solution for building websites, mobile apps and forms. This tool is intended to find common bugs and bad smells specific for AEM development. Documentation of each rule is available from SonarQube interface after plugin installation. +As we all know, SonarQube is a great tool that helps us increase quality of our codebase. However, it does apply mainly to general Java issues. As we know, we can hurt ourselves much more doing AEM. [Adobe Experience Manager](https://experienceleague.adobe.com/en/docs) is a comprehensive content management platform solution for building websites, mobile apps and forms. This tool is intended to find common bugs and bad smells specific for AEM development. Documentation of each rule is available from SonarQube interface after plugin installation. ## Prerequisites @@ -15,25 +17,16 @@ Each release has its own prerequisites section, for more information please chec ## Installation -**Custom Dockerfile** +### Local docker image -Following Dockerfile uses official Sonarqube 7.9 image and download AEM Rules 1.0-RC2 to plugin directory. +Check the plugin locally with the prepared ```docker-compose.yml```. Just run these commands from the repo root to build the latest package and fire up a container. ``` -FROM sonarqube:7.9-community AS aemrulesqube79 -RUN curl -Lk -o $SONARQUBE_HOME/extensions/plugins/aemrules-1.0-RC2.jar https://github.com/wttech/AEM-Rules-for-SonarQube/releases/download/v1.0-RC2/aemrules-1.0-RC2.jar +mvn clean package +cd local-docker-image +docker-compose up -d ``` -**Community image** - -This is already prepared solution thanks to @ahmed-musallam. - -`docker run --rm -p 9000:9000 ahmedmusallam/sonarqube-aem:latest` - -This solution is for those who would like to start testing theirs code within aem rules and sonarqube. It contains SonarQube v 7.7, aem rules v 0.11 and predefined quality gates. -If you would like to participate in our Aem Rules development, please refer to [wiki page](https://github.com/wttech/AEM-Rules-for-SonarQube/wiki) to get into. - - ### Update Center Go to your SonarQube instance administration console and open Update Center. Find AEM Rules for SonarQube plugin and click install! @@ -50,7 +43,8 @@ Go to your SonarQube instance administration console and open Update Center. Fin Use of the plugin does not differ much from regular SonarQube analysis. However, as rules are often tied to a certain AEM version and its components (Felix, Sling), we've introduced the `aemVersion` analysis property. Each rule defines supported AEM version or version range. Most of the rules are universal. -By providing the AEM version parameter, you can instruct the Sonar Runner to only use only a subset of rules applicable to a particular AEM version. When the parameter is not provided then a default AEM version is used (currently 6.4) + +Rules are not available in [Not available in SonarLint](https://www.sonarlint.org/) ### Running analysis @@ -58,14 +52,19 @@ When running analysis, pass `sonarRunner.aemVersion` property with your AEM vers `sonarRunner.aemVersion=.` -Runing with Maven -``` -mvn sonar:sonar -DsonarRunner.aemVersion=6.4 -``` +To avoid quality profiles collisions, the additional execution param has been added. + +`-Dsonar.html.file.suffixes=.notexistingsuffix` -Runing with Gradle (See [Gradle AEM Plugin](https://github.com/wttech/gradle-aem-plugin)) +Running with Maven ``` -gradlew sonarQube -DsonarRunner.aemVersion=6.4 +mvn clean verify sonar:sonar \ + -Dsonar.projectKey={sonar_project_key} \ + -Dsonar.projectName='{sonar_project_name}' \ + -Dsonar.host.url=http://localhost:9000 \ + -Dsonar.token={sonar_project_token} \ + -DsonarRunner.aemVersion=6.5 \ + -Dsonar.html.file.suffixes=.notexistingsuffix ``` # Rule set @@ -178,13 +177,13 @@ Release notes for each version can be found in [releases section](https://github # License -Copyright 2015-2016 Wunderman Thompson Technology +Copyright 2015-2024 VML Licensed under the Apache License, Version 2.0 # Commercial Support -Technical support can be made available if needed. Please [contact us](mailto:labs-support@cognifide.com) for more details. +Technical support can be made available if needed. Please [contact us](mailto:labs-support@wundermanthompson.com) for more details. We can: diff --git a/assets/license-template.txt b/assets/license-template.txt index 7acb61a..38d31a4 100644 --- a/assets/license-template.txt +++ b/assets/license-template.txt @@ -1,7 +1,7 @@ #%L ${project.name} %% -Copyright (C) ${project.inceptionYear}-2019 Wunderman Thompson Technology +Copyright (C) ${project.inceptionYear}-2024 VML %% Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/local-docker-image/Dockerfile b/local-docker-image/Dockerfile deleted file mode 100644 index b77923b..0000000 --- a/local-docker-image/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# -# #%L -# AEM Rules for SonarQube -# %% -# Copyright (C) 2015-2024 VML -# %% -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# #L% -# - -FROM sonarqube:10.7.0-community AS aemrulesqube1070 -RUN curl -Lk -o $SONARQUBE_HOME/extensions/plugins/aemrules-1.0-RC2.jar https://github.com/wttech/AEM-Rules-for-SonarQube/releases/download/v1.0-RC2/aemrules-1.0-RC2.jar \ No newline at end of file diff --git a/local-docker-image/docker-compose.yml b/local-docker-image/docker-compose.yml index 488d32c..2a0dd27 100644 --- a/local-docker-image/docker-compose.yml +++ b/local-docker-image/docker-compose.yml @@ -18,11 +18,11 @@ # #L% # -name: sonar-test +name: sonar-local services: - sonar-test: - image: wttech/sonar-test + sonar-local: + image: sonarqube:10.7.0-community build: context: . ports: diff --git a/src/main/java/com/vml/aemrules/version/VersionSupportChecker.java b/src/main/java/com/vml/aemrules/version/VersionSupportChecker.java index 67f6469..8a28f93 100644 --- a/src/main/java/com/vml/aemrules/version/VersionSupportChecker.java +++ b/src/main/java/com/vml/aemrules/version/VersionSupportChecker.java @@ -29,7 +29,7 @@ public class VersionSupportChecker { public static final String VERSION_PROPERTY = "sonarRunner.aemVersion"; - public static final String DEFAULT_AEM_VERSION = "6.4"; + public static final String DEFAULT_AEM_VERSION = "6.5"; private boolean all = false;