diff --git a/.github/workflows/code-maven_java-PR_verify.yml b/.github/workflows/code-maven_java-PR_verify.yml index e1e9988..2c16474 100644 --- a/.github/workflows/code-maven_java-PR_verify.yml +++ b/.github/workflows/code-maven_java-PR_verify.yml @@ -72,6 +72,7 @@ jobs: run: | echo "app-version=$(yq -oy '.project.version' code/pom.xml)" >> "$GITHUB_OUTPUT" echo "app-name=$(yq -oy '.project.artifactId' code/pom.xml)" >> "$GITHUB_OUTPUT" + echo "github-repository=$(echo $GITHUB_REPOSITORY | cut -d'/' -f2)" >> "$GITHUB_OUTPUT" - name: Maven / Verify artifact with coverage if: ${{ !(contains(github.event.pull_request.labels.*.name, 'autopublish/snapshot-binaries')) }} @@ -121,7 +122,7 @@ jobs: run: | JACOCO_REPORT_PATH="$GITHUB_WORKSPACE/code/jacoco-report-aggregate/target/site/jacoco-aggregate/jacoco.xml" mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar \ - -Dsonar.projectKey=InditexTech_"${{ steps.version.outputs.app-name }}" \ + -Dsonar.projectKey=InditexTech_"${{ steps.version.outputs.github-repository }}" \ -Dsonar.projectName="${{ steps.version.outputs.app-name }}" \ -Dsonar.projectVersion="${{ steps.version.outputs.app-version }}" \ -Dsonar.host.url="https://sonarcloud.io/" \ diff --git a/.github/workflows/code-maven_java-sonarcloud-analysis.yml b/.github/workflows/code-maven_java-sonarcloud-analysis.yml index 643727e..f69fea1 100644 --- a/.github/workflows/code-maven_java-sonarcloud-analysis.yml +++ b/.github/workflows/code-maven_java-sonarcloud-analysis.yml @@ -89,6 +89,7 @@ jobs: run: | echo "app-version=$(yq -oy '.project.version' code/pom.xml)" >> "$GITHUB_OUTPUT" echo "app-name=$(yq -oy '.project.artifactId' code/pom.xml)" >> "$GITHUB_OUTPUT" + echo "github-repository=$(echo $GITHUB_REPOSITORY | cut -d'/' -f2)" >> "$GITHUB_OUTPUT" - name: SonarCloud / Setup asdf tools uses: asdf-vm/actions/install@v3 @@ -120,7 +121,7 @@ jobs: run: | JACOCO_REPORT_PATH="$GITHUB_WORKSPACE/code/jacoco-report-aggregate/target/site/jacoco-aggregate/jacoco.xml" mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar \ - -Dsonar.projectKey=InditexTech_"${{ steps.version.outputs.app-name }}" \ + -Dsonar.projectKey=InditexTech_"${{ steps.version.outputs.github-repository }}" \ -Dsonar.projectName="${{ steps.version.outputs.app-name }}" \ -Dsonar.projectVersion="${{ github.event.release.tag_name }}" \ -Dsonar.branch.name="release/${{ github.event.release.tag_name }}" \ @@ -138,7 +139,7 @@ jobs: run: | JACOCO_REPORT_PATH="$GITHUB_WORKSPACE/code/jacoco-report-aggregate/target/site/jacoco-aggregate/jacoco.xml" mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar \ - -Dsonar.projectKey=InditexTech_"${{ steps.version.outputs.app-name }}" \ + -Dsonar.projectKey=InditexTech_"${{ steps.version.outputs.github-repository }}" \ -Dsonar.projectName="${{ steps.version.outputs.app-name }}" \ -Dsonar.projectVersion="${{ steps.version.outputs.app-version }}" \ -Dsonar.branch.name="${{ github.base_ref || github.ref_name }}" \ diff --git a/code/generators/src/main/java/dev/inditex/karate/openapi/data/MavenArtifact.java b/code/generators/src/main/java/dev/inditex/karate/openapi/data/MavenArtifact.java index 596175d..91fb047 100644 --- a/code/generators/src/main/java/dev/inditex/karate/openapi/data/MavenArtifact.java +++ b/code/generators/src/main/java/dev/inditex/karate/openapi/data/MavenArtifact.java @@ -38,9 +38,7 @@ public String getId() { */ public static MavenArtifact fromId(final String id) { if (id.indexOf(":") >= 0 && id.split(":").length == 2) { - final String groupId = id.split(":")[0]; - final String artifactId = id.split(":")[1]; - return new MavenArtifact(groupId, artifactId); + return new MavenArtifact(id.split(":")[0], id.split(":")[1]); } return null; }