diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml
index ae3cddecd98d..284b008998ee 100644
--- a/.github/workflows/sonar-scan.yml
+++ b/.github/workflows/sonar-scan.yml
@@ -22,10 +22,10 @@ jobs:
         uses: actions/checkout@v3
         with:
           fetch-depth: '0'
-      - name: Set up JDK 17
+      - name: Set up JDK 11
         uses: actions/setup-java@v2
         with:
-          java-version: 17
+          java-version: 11.0.16+8
           distribution: 'temurin'
       - name: Cache Maven packages
         uses: actions/cache@v3
@@ -33,7 +33,16 @@ jobs:
           path: ~/.m2
           key: ${{ runner.os }}-m2
           restore-keys: ${{ runner.os }}-m2
-
+      - name: Build carbon-apimgt with Tests, skipping AspectJ
+        run: mvn clean install --file pom.xml -Dskip.aspectj=true  -Dmaven.test.skip=true
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+      - name: Set up JDK 17
+        uses: actions/setup-java@v2
+        with:
+          java-version: 17
+          distribution: 'temurin'
       - name: Cache SonarCloud packages
         uses: actions/cache@v3
         with:
@@ -41,7 +50,7 @@ jobs:
           key: ${{ runner.os }}-sonar
           restore-keys: ${{ runner.os }}-sonar
 
-      - name: Build carbon-apimgt with Tests, skipping AspectJ
+      - name: run sonar scan
         run: mvn sonar:sonar --file pom.xml -Dskip.aspectj=true  -Dmaven.test.skip=true
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}