Skip to content

Commit

Permalink
Merge pull request #110 from spring-petclinic/feature/sonarqube
Browse files Browse the repository at this point in the history
Configure Sonar scanner
  • Loading branch information
arey authored Dec 29, 2023
2 parents aebf338 + 1458b5a commit 0cbce78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened]

jobs:
build:
Expand All @@ -25,5 +25,8 @@ jobs:
java-version: ${{matrix.java}}
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: ./mvnw -B package
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./mvnw -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=spring-petclinic_spring-framework-petclinic
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>

<!-- SonarQube configuration -->
<sonar.organization>spring-petclinic</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

<!-- Spring -->
<!-- For framework compatibility, refer to the Spring Boot Dependencies BOM and to the gradle.properties -->
<!-- https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-dependencies/build.gradle -->
Expand Down

0 comments on commit 0cbce78

Please sign in to comment.