From 51e541d229101b8714e5c636f2e750d653a0d330 Mon Sep 17 00:00:00 2001 From: Alberto Codutti Date: Thu, 12 Dec 2024 16:50:15 +0100 Subject: [PATCH 1/2] :white_check_mark: [CI] Added Sonar analysis Signed-off-by: Alberto Codutti --- .github/workflows/sonarCloud-scan.yaml | 49 ++++++++++++++++++++++++++ pom.xml | 30 ++++++++++++++++ simulator-kura/pom.xml | 2 -- 3 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/sonarCloud-scan.yaml diff --git a/.github/workflows/sonarCloud-scan.yaml b/.github/workflows/sonarCloud-scan.yaml new file mode 100644 index 00000000000..17519fb5245 --- /dev/null +++ b/.github/workflows/sonarCloud-scan.yaml @@ -0,0 +1,49 @@ +name: Sonar Scan + +on: + push: + branches: + - 'develop' + - 'release-**' + pull_request: + branches: + - 'develop' + - 'release-**' + +jobs: + build: + name: Analyze + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: 'zulu' + - name: Set up Node 16 + uses: actions/setup-node@v4 + with: + node-version: 16 + - name: Install Swagger CLI # Installs Swagger CLI to bundle OpenAPI files + run: 'npm install -g @apidevtools/swagger-cli' + - name: Cache SonarQube packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B compile -PsonarScan + diff --git a/pom.xml b/pom.xml index 5f2c0c56321..484b09d6240 100644 --- a/pom.xml +++ b/pom.xml @@ -169,6 +169,7 @@ 4.4.2 1.9 1.6.5 + 5.0.0.4389 1.5 3.0.0-M7 @@ -177,7 +178,10 @@ yyyy-MM-dd ${maven.build.timestamp} + https://sonarcloud.io + eclipse_kapua + eclipse-github @@ -501,6 +505,11 @@ + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonar-maven-plugin.version} + @@ -2837,6 +2846,27 @@ + + + sonarScan + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + + + compile + + sonar + + + + + + + + diff --git a/simulator-kura/pom.xml b/simulator-kura/pom.xml index f22f8bc56ad..1929cf82af1 100644 --- a/simulator-kura/pom.xml +++ b/simulator-kura/pom.xml @@ -19,14 +19,12 @@ org.eclipse.kapua kapua 2.1.0-SNAPSHOT - .. kapua-simulator-kura This is a framework for simulating Eclipse Kura IoT gateway instances - UTF-8 kapua 6.0.0 From 63d9783f55aa5964b68d8c7deede4914b25ddfa8 Mon Sep 17 00:00:00 2001 From: Alberto Codutti Date: Fri, 13 Dec 2024 17:29:15 +0100 Subject: [PATCH 2/2] :wrench: [Code] Sorted versions in pom properties Signed-off-by: Alberto Codutti --- commons/pom.xml | 4 ++-- pom.xml | 12 +++++------- service/account/internal/pom.xml | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/commons/pom.xml b/commons/pom.xml index b6b188fceec..ce7f4dee901 100644 --- a/commons/pom.xml +++ b/commons/pom.xml @@ -42,13 +42,13 @@ org.mapstruct mapstruct-processor - ${org.mapstruct.version} + ${mapstruct.version} org.hibernate hibernate-jpamodelgen - ${org.hibernate.hibernate-jpamodelgen.version} + ${hibernate-jpamodelgen.version} diff --git a/pom.xml b/pom.xml index 484b09d6240..7d7fab59ef3 100644 --- a/pom.xml +++ b/pom.xml @@ -70,6 +70,7 @@ 1.2 2.3 1.0.3 + 6.11.0 2.7.12 3.2.2 @@ -82,6 +83,7 @@ 5.1.0 2.2 1.4.200 + 5.5.4.Final 4.0.3 2.6.1 4.1.5 @@ -96,7 +98,6 @@ 1.0.4 2.1.1 3.1.0 - 1.5.5.Final 2.0.1.Final 2.1.6 2.3.3 @@ -115,6 +116,7 @@ 2.17.1 0.0.2 1.5.12 + 1.5.5.Final 1.10.19 4.1.114.Final 3.10.6.Final @@ -134,9 +136,6 @@ 5.3.1 3.4.1 - 6.11.0 - 8.15.1 - 3.1.0 3.0.0 @@ -173,7 +172,6 @@ 1.5 3.0.0-M7 - 5.5.4.Final yyyy-MM-dd ${maven.build.timestamp} @@ -2093,7 +2091,7 @@ org.mapstruct mapstruct - ${org.mapstruct.version} + ${mapstruct.version} @@ -2656,7 +2654,7 @@ org.hibernate hibernate-jpamodelgen - ${org.hibernate.hibernate-jpamodelgen.version} + ${hibernate-jpamodelgen.version} diff --git a/service/account/internal/pom.xml b/service/account/internal/pom.xml index 71752c3fb47..d774ec36bf1 100644 --- a/service/account/internal/pom.xml +++ b/service/account/internal/pom.xml @@ -91,13 +91,13 @@ org.mapstruct mapstruct-processor - ${org.mapstruct.version} + ${mapstruct.version} org.hibernate hibernate-jpamodelgen - ${org.hibernate.hibernate-jpamodelgen.version} + ${hibernate-jpamodelgen.version}