From b979624e1b60cdc2261337b77dbff09a74693fb2 Mon Sep 17 00:00:00 2001 From: Amit <47300261+devopstrainer1@users.noreply.github.com> Date: Mon, 25 Aug 2025 07:52:47 +0530 Subject: [PATCH 1/3] Create maven-publish.yml --- .github/workflows/maven-publish.yml | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/maven-publish.yml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 000000000..7e373006a --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,31 @@ +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path + +name: Maven Package + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build with Maven + run: mvn -B package --file pom.xml From 967026ada8def257a6c3efc8edf952bf1b5368c6 Mon Sep 17 00:00:00 2001 From: Amit <47300261+devopstrainer1@users.noreply.github.com> Date: Mon, 25 Aug 2025 08:00:33 +0530 Subject: [PATCH 2/3] Update maven-publish.yml --- .github/workflows/maven-publish.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 7e373006a..5c9bf3ae7 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -29,3 +29,12 @@ jobs: - name: Build with Maven run: mvn -B package --file pom.xml + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4.6 + with: + name: address-war + path: target/addressbook.war + + + From df182bd338f9c179e48594559db44943ea755f1c Mon Sep 17 00:00:00 2001 From: Amit <47300261+devopstrainer1@users.noreply.github.com> Date: Mon, 25 Aug 2025 08:01:38 +0530 Subject: [PATCH 3/3] Update maven-publish.yml --- .github/workflows/maven-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 5c9bf3ae7..6c532000d 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -31,7 +31,7 @@ jobs: run: mvn -B package --file pom.xml - name: Upload a Build Artifact - uses: actions/upload-artifact@v4.6 + uses: actions/upload-artifact@v4 with: name: address-war path: target/addressbook.war