From 0f137ca3d1a42f99a903f4554ab00e76efc7fd2f Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:05:28 +0530 Subject: [PATCH 01/42] Create main.yml --- .github/workflows/main.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..34ef7de --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,29 @@ +name: Build and Test Spring Boot Application + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + + - name: Build with Maven + run: mvn clean install -DskipTests + + - name: Run tests + run: mvn test From af46ee7d0e007b54ffffc6fe75a6f20530773bc6 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:10:26 +0530 Subject: [PATCH 02/42] Update main.yml --- .github/workflows/main.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 34ef7de..507e4a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,4 @@ name: Build and Test Spring Boot Application - on: push: branches: @@ -7,23 +6,18 @@ on: pull_request: branches: - main - jobs: build: runs-on: ubuntu-latest - steps: - name: Checkout code uses: actions/checkout@v3 - - name: Set up JDK 11 uses: actions/setup-java@v3 with: java-version: '11' - distribution: 'temurin' - + distribution: temurin - name: Build with Maven run: mvn clean install -DskipTests - - name: Run tests run: mvn test From 96a85573e85ee6f3d42ee0d0fb0635a851939e95 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:17:57 +0530 Subject: [PATCH 03/42] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 507e4a5..8ea109d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,8 @@ jobs: with: java-version: '11' distribution: temurin + - name: Change to the subdirectory + run: cd simple-springboot-app - name: Build with Maven run: mvn clean install -DskipTests - name: Run tests From 2f72c93ae8dea87b0ea3cdf6a9109784ac0a8342 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:19:38 +0530 Subject: [PATCH 04/42] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ea109d..b2a51c1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,8 @@ jobs: distribution: temurin - name: Change to the subdirectory run: cd simple-springboot-app + - name: List files + run: ls -al - name: Build with Maven run: mvn clean install -DskipTests - name: Run tests From c5e4412283b0f4efc200ee9e75da0718cb0235bb Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:20:34 +0530 Subject: [PATCH 05/42] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b2a51c1..2c6d95a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: java-version: '11' distribution: temurin - name: Change to the subdirectory - run: cd simple-springboot-app + run: cd ./simple-springboot-app/ - name: List files run: ls -al - name: Build with Maven From e16a2ca9642b7753ad78c0fc017cfa5465462d08 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:21:52 +0530 Subject: [PATCH 06/42] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c6d95a..3b53e3b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: java-version: '11' distribution: temurin - name: Change to the subdirectory - run: cd ./simple-springboot-app/ + run: cd simple-springboot-app/simple-springboot-app/ - name: List files run: ls -al - name: Build with Maven From 0cad28fb01acac3f7e90e1adf230fed095440e49 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:24:19 +0530 Subject: [PATCH 07/42] Update main.yml --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b53e3b..db6496a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,9 @@ jobs: java-version: '11' distribution: temurin - name: Change to the subdirectory - run: cd simple-springboot-app/simple-springboot-app/ + run: cd simple-springboot-app/ + - name : list running folder + run: pwd - name: List files run: ls -al - name: Build with Maven From eb2193a79ab57d2c66a6551c9e8505388a69c125 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:27:30 +0530 Subject: [PATCH 08/42] Update main.yml --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index db6496a..684cc9b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,8 +17,6 @@ jobs: with: java-version: '11' distribution: temurin - - name: Change to the subdirectory - run: cd simple-springboot-app/ - name : list running folder run: pwd - name: List files From 06c363dd2389fc46ba3b5a99197d92e5f997da28 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:28:40 +0530 Subject: [PATCH 09/42] Delete .gitignore --- .gitignore | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ca4e025..0000000 --- a/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.iml -.project -.settings/ -.classpath -target/ -.springBeans -.factorypath - From 02480f70d01277367d1542964bf39b0e3db6ff34 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:29:17 +0530 Subject: [PATCH 10/42] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 684cc9b..acd261e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: - name : list running folder run: pwd - name: List files - run: ls -al + run: cd simple-springboot-app - name: Build with Maven run: mvn clean install -DskipTests - name: Run tests From a67da1dee95ef9ce3cb5f3976ce2d664ff0f4e6b Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:37:17 +0530 Subject: [PATCH 11/42] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index acd261e..6f81236 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,6 @@ jobs: - name: List files run: cd simple-springboot-app - name: Build with Maven - run: mvn clean install -DskipTests + run: mvn clean install - name: Run tests run: mvn test From 078cb85e03650548ee84e5b04c325391230da672 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:39:07 +0530 Subject: [PATCH 12/42] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6f81236..98d7381 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,8 @@ jobs: - name: List files run: cd simple-springboot-app - name: Build with Maven + working-directory: ./simple-springboot-app run: mvn clean install - name: Run tests + working-directory: ./simple-springboot-app run: mvn test From 9c26bd3eb43e41b0bf0ae55370a3c7771b8beb01 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:40:08 +0530 Subject: [PATCH 13/42] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 98d7381..224e4d3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: run: cd simple-springboot-app - name: Build with Maven working-directory: ./simple-springboot-app - run: mvn clean install + run: mvn clean install -DskipTests - name: Run tests working-directory: ./simple-springboot-app run: mvn test From 28c4127b837c3cb96848879e2c2292dc377806eb Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:43:35 +0530 Subject: [PATCH 14/42] Create dockerfile --- dockerfile | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 dockerfile diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..add0880 --- /dev/null +++ b/dockerfile @@ -0,0 +1,3 @@ +FROM openjdk:11-jre-slim +COPY target/*.jar app.jar +ENTRYPOINT ["java", "-jar", "/app.jar"] From ae35bf50fa73159cddd19ba1046976afbe6a2615 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:46:49 +0530 Subject: [PATCH 15/42] Update main.yml building image --- .github/workflows/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 224e4d3..7c1cfef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,6 +24,12 @@ jobs: - name: Build with Maven working-directory: ./simple-springboot-app run: mvn clean install -DskipTests - - name: Run tests - working-directory: ./simple-springboot-app - run: mvn test + - name: Build Docker image + run: | + docker build -t shubhamcg1234/simple-springboot-app . + echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin + docker push your-dockerhub-username/simple-springboot-app + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + From fa74145ff9c5fab5d0b99b9878f557d738b30f6c Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:49:50 +0530 Subject: [PATCH 16/42] Update pom.xml --- simple-springboot-app/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/simple-springboot-app/pom.xml b/simple-springboot-app/pom.xml index 671aca5..5e1693e 100644 --- a/simple-springboot-app/pom.xml +++ b/simple-springboot-app/pom.xml @@ -50,6 +50,7 @@ org.springframework.boot spring-boot-maven-plugin + 2.7.0 From 7fc0bc3b6b9f26237b3b1fb65e76db4425c6cacf Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:50:24 +0530 Subject: [PATCH 17/42] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c1cfef..727059e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: run: cd simple-springboot-app - name: Build with Maven working-directory: ./simple-springboot-app - run: mvn clean install -DskipTests + run: mvn clean package -DskipTests - name: Build Docker image run: | docker build -t shubhamcg1234/simple-springboot-app . From 01dfc9cd1d9cbe61715093589589631dfad632e2 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:53:56 +0530 Subject: [PATCH 18/42] Create file --- simple-springboot-app/target/file | 1 + 1 file changed, 1 insertion(+) create mode 100644 simple-springboot-app/target/file diff --git a/simple-springboot-app/target/file b/simple-springboot-app/target/file new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/simple-springboot-app/target/file @@ -0,0 +1 @@ + From 018270ebac7fafb13ce6ae0cebbf4934a3cc285d Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:56:51 +0530 Subject: [PATCH 19/42] Update main.yml --- .github/workflows/main.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 727059e..4b52e2c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,17 +19,10 @@ jobs: distribution: temurin - name : list running folder run: pwd - - name: List files - run: cd simple-springboot-app - name: Build with Maven working-directory: ./simple-springboot-app run: mvn clean package -DskipTests - - name: Build Docker image - run: | - docker build -t shubhamcg1234/simple-springboot-app . - echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin - docker push your-dockerhub-username/simple-springboot-app - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + - name: List files + working-directory: ./simple-springboot-app + run: ls -ls From 24fc84a38121288a72186b9941c950b0288b3db1 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 10:59:44 +0530 Subject: [PATCH 20/42] Update dockerfile --- dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dockerfile b/dockerfile index add0880..f8898b3 100644 --- a/dockerfile +++ b/dockerfile @@ -1,3 +1,4 @@ FROM openjdk:11-jre-slim -COPY target/*.jar app.jar +COPY ./simple-springboot-app/target/*.jar app.jar +EXPOSE 8080 ENTRYPOINT ["java", "-jar", "/app.jar"] From 28aafd7dcc58ee022ec7187f6f313d110ee12ded Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:02:33 +0530 Subject: [PATCH 21/42] Update main.yml --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b52e2c..dd28d22 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,4 +25,10 @@ jobs: - name: List files working-directory: ./simple-springboot-app run: ls -ls + docker build -t shubhamcg1234/simple-springboot-app . + echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin + docker push shubhamcg1234/simple-springboot-app + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} From decc6f772140005a669cb58423a155e6c70ce462 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:04:19 +0530 Subject: [PATCH 22/42] Update main.yml --- .github/workflows/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd28d22..c5a5da5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,9 +25,11 @@ jobs: - name: List files working-directory: ./simple-springboot-app run: ls -ls + - name: Build Docker image + run: | docker build -t shubhamcg1234/simple-springboot-app . - echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin - docker push shubhamcg1234/simple-springboot-app + echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin + docker push shubhamcg1234/simple-springboot-app env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} From eb7dc48c557a6f5bcdf9ee937c425d188be3ec5e Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:18:09 +0530 Subject: [PATCH 23/42] Update pom.xml --- simple-springboot-app/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/simple-springboot-app/pom.xml b/simple-springboot-app/pom.xml index 5e1693e..7e32268 100644 --- a/simple-springboot-app/pom.xml +++ b/simple-springboot-app/pom.xml @@ -23,6 +23,10 @@ UTF-8 1.8 + + blackpandacg + https://sonarcloud.io + From 53bdc49cb78c013eb0581474e2356b6f473ef5d8 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:23:30 +0530 Subject: [PATCH 24/42] Update pom.xml --- simple-springboot-app/pom.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/simple-springboot-app/pom.xml b/simple-springboot-app/pom.xml index 7e32268..4b492ff 100644 --- a/simple-springboot-app/pom.xml +++ b/simple-springboot-app/pom.xml @@ -22,9 +22,7 @@ UTF-8 UTF-8 1.8 - - - blackpandacg + blackpandacg https://sonarcloud.io @@ -56,6 +54,11 @@ spring-boot-maven-plugin 2.7.0 + + org.sonarsource.scanner.maven + sonar-maven-plugin + 3.9.1.2184 + From 071dcb892af92cdb6f71e6b1f5f24595ee135786 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:25:39 +0530 Subject: [PATCH 25/42] Update main.yml --- .github/workflows/main.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c5a5da5..1863209 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,7 @@ on: pull_request: branches: - main + types: [opened, synchronize, reopened] jobs: build: runs-on: ubuntu-latest @@ -25,6 +26,21 @@ jobs: - name: List files working-directory: ./simple-springboot-app run: ls -ls + - name: Cache SonarQube packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Build and analyze + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=blackpandacg_simple-springboot-app + - name: Upload SonarCloud results to GitHub + uses: sonarsource/sonarcloud-github-action@v1 + with: + sonar-project-key: blackpandacg_simple-springboot-app + sonar-token: ${{ secrets.SONAR_TOKEN }} - name: Build Docker image run: | docker build -t shubhamcg1234/simple-springboot-app . From 3944c63420cd7fdf783b80e5327cb40547a7db39 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:29:04 +0530 Subject: [PATCH 26/42] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1863209..0ceda42 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,6 +35,7 @@ jobs: - name: Build and analyze env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + working-directory: ./simple-springboot-app run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=blackpandacg_simple-springboot-app - name: Upload SonarCloud results to GitHub uses: sonarsource/sonarcloud-github-action@v1 From 7ae36b56a077873bb839b7c40cc6a6d2239d640d Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:35:19 +0530 Subject: [PATCH 27/42] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ceda42..88ad302 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} working-directory: ./simple-springboot-app - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=blackpandacg_simple-springboot-app + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=blackpandacg_simple-springboot-app -Dsonar.coverage.exclusions="**/*Tests.java" - name: Upload SonarCloud results to GitHub uses: sonarsource/sonarcloud-github-action@v1 with: From 671b0a20f60de6c54c49c1df5205180f309fa235 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:38:02 +0530 Subject: [PATCH 28/42] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 88ad302..c1ece88 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: run: pwd - name: Build with Maven working-directory: ./simple-springboot-app - run: mvn clean package -DskipTests + run: mvn clean package -Dmaven.test.skip=true - name: List files working-directory: ./simple-springboot-app run: ls -ls From 23af31d27335f1680f4684ad1898331950b32b33 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:44:07 +0530 Subject: [PATCH 29/42] Update pom.xml --- simple-springboot-app/pom.xml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/simple-springboot-app/pom.xml b/simple-springboot-app/pom.xml index 4b492ff..c52bbe7 100644 --- a/simple-springboot-app/pom.xml +++ b/simple-springboot-app/pom.xml @@ -54,13 +54,21 @@ spring-boot-maven-plugin 2.7.0 + - org.sonarsource.scanner.maven - sonar-maven-plugin - 3.9.1.2184 + org.sonarsource.scanner.maven + sonar-maven-plugin + 3.9.1.2184 + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M5 + + true + - - From fade3e1c8ada67c595e0f0062db79f0f2f4e8508 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:46:53 +0530 Subject: [PATCH 30/42] Update main.yml --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c1ece88..d0cee0d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,11 +13,11 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '11' - distribution: temurin + java-version: '17' + distribution: 'temurin' - name : list running folder run: pwd - name: Build with Maven From a8a0de17cd72ee5217f8b2f63e9f3ac23bd0ad14 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:50:26 +0530 Subject: [PATCH 31/42] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d0cee0d..4befece 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,9 +33,9 @@ jobs: key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Build and analyze - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} working-directory: ./simple-springboot-app + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=blackpandacg_simple-springboot-app -Dsonar.coverage.exclusions="**/*Tests.java" - name: Upload SonarCloud results to GitHub uses: sonarsource/sonarcloud-github-action@v1 From ebb0c1b6aff74c02c53734fd1b3736bebea2ced1 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:54:56 +0530 Subject: [PATCH 32/42] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4befece..c7261c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,6 +38,7 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=blackpandacg_simple-springboot-app -Dsonar.coverage.exclusions="**/*Tests.java" - name: Upload SonarCloud results to GitHub + working-directory: ./simple-springboot-app uses: sonarsource/sonarcloud-github-action@v1 with: sonar-project-key: blackpandacg_simple-springboot-app From 0d75d3745c853e33927171bce0e584f8daca4eeb Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:56:15 +0530 Subject: [PATCH 33/42] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c7261c6..fd3c3f5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,9 +38,9 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=blackpandacg_simple-springboot-app -Dsonar.coverage.exclusions="**/*Tests.java" - name: Upload SonarCloud results to GitHub - working-directory: ./simple-springboot-app uses: sonarsource/sonarcloud-github-action@v1 with: + working-directory: ./simple-springboot-app sonar-project-key: blackpandacg_simple-springboot-app sonar-token: ${{ secrets.SONAR_TOKEN }} - name: Build Docker image From b9cd196d294cb882a07d7edf0a418d75c14c638f Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 11:59:12 +0530 Subject: [PATCH 34/42] Update main.yml --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd3c3f5..ae4c280 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,6 +43,9 @@ jobs: working-directory: ./simple-springboot-app sonar-project-key: blackpandacg_simple-springboot-app sonar-token: ${{ secrets.SONAR_TOKEN }} + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Build Docker image run: | docker build -t shubhamcg1234/simple-springboot-app . From 90f726f10b708007046079c2f7b2a969b17d9ef1 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:05:38 +0530 Subject: [PATCH 35/42] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ae4c280..b0c2868 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,8 @@ jobs: with: java-version: '17' distribution: 'temurin' + - name: Verify Java version + run: java -version - name : list running folder run: pwd - name: Build with Maven From d14cd51b08a7cb58389c455a86c4344567a9f9e3 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:09:29 +0530 Subject: [PATCH 36/42] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b0c2868..24090a8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + - name: Remove previous Java installations + run: sudo apt-get remove -y openjdk-* - name: Set up JDK 17 uses: actions/setup-java@v3 with: From fab41bf07686f9b31fd2f35c3ba66c0caa19b5f9 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:11:34 +0530 Subject: [PATCH 37/42] Update main.yml --- .github/workflows/main.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 24090a8..e4638d4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,12 +30,6 @@ jobs: - name: List files working-directory: ./simple-springboot-app run: ls -ls - - name: Cache SonarQube packages - uses: actions/cache@v4 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - name: Build and analyze working-directory: ./simple-springboot-app env: From 918593148f0d47ce12e4f29d83240c9ff8a1f92b Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:13:44 +0530 Subject: [PATCH 38/42] Update main.yml --- .github/workflows/main.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e4638d4..137ea66 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,16 +34,7 @@ jobs: working-directory: ./simple-springboot-app env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=blackpandacg_simple-springboot-app -Dsonar.coverage.exclusions="**/*Tests.java" - - name: Upload SonarCloud results to GitHub - uses: sonarsource/sonarcloud-github-action@v1 - with: - working-directory: ./simple-springboot-app - sonar-project-key: blackpandacg_simple-springboot-app - sonar-token: ${{ secrets.SONAR_TOKEN }} - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=blackpandacg_simple-springboot-app -Dsonar.coverage.exclusions="**/*Tests.java" - name: Build Docker image run: | docker build -t shubhamcg1234/simple-springboot-app . From 157d5256a29e4c504b39576562b0f5776ece5f27 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:15:11 +0530 Subject: [PATCH 39/42] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 137ea66..115c092 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,10 +2,10 @@ name: Build and Test Spring Boot Application on: push: branches: - - main + - master pull_request: branches: - - main + - master types: [opened, synchronize, reopened] jobs: build: From e12edb918bd4aeca8ed0d0d0f20c307740c29550 Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:15:45 +0530 Subject: [PATCH 40/42] Update dockerfile From e15e5fa0ecc1eff4a8bbbc54a4720ff1eed552af Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:26:14 +0530 Subject: [PATCH 41/42] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 115c092..f4b3419 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,6 +3,7 @@ on: push: branches: - master + - 'feature/*' pull_request: branches: - master From e940ff7676b819c3117151ad4850ccb5acb0a83a Mon Sep 17 00:00:00 2001 From: blackpandacg <38292847+blackpandacg@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:32:08 +0530 Subject: [PATCH 42/42] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd1e15d..29a1823 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Simple Spring Boot Application - A Quick Start Guide - +making some changes It is an approach to develop spring based application with very less configuration. It provides defaults for code and annotation configuration to quick start new spring projects within no time.