Skip to content

Merge pull request #12 from arumugamsubramanian/develop #39

Merge pull request #12 from arumugamsubramanian/develop

Merge pull request #12 from arumugamsubramanian/develop #39

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Java CI with Maven
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
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: Prepare a build
run: |
echo "$MAVEN_HOME"
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/commons-core-automation.jar -DgroupId=com.snc -DartifactId=commons-core-automation -Dversion=19.0.0.0 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/snc-automation-api.jar -DgroupId=com.snc -DartifactId=snc-automation-api -Dversion=19.0.0.0 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/commons-glide.jar -DgroupId=com.snc -DartifactId=commons-glide -Dversion=19.0.0.0 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/gson.jar -DgroupId=com.google.code.gson -DartifactId=gson -Dversion=2.8.2 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/guava.jar -DgroupId=com.google.guava -DartifactId=guava -Dversion=2.8.2 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/mid.jar -DgroupId=com.snc -DartifactId=mid -Dversion=19.0.0.0 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/azure-core-http-okhttp-1.11.6.jar -DgroupId=com.azure.local -DartifactId=azure-core-http-okhttp -Dversion=1.11.6 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
- name: Delete file
run: |
rm -rf "$HOME/.m2/repository/com/snc/commons-core-automation/19.0.0.0/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/snc/snc-automation-api/19.0.0.0/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/snc/commons-glide/19.0.0.0/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/google/code/gson/gson/2.8.2/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/google/guava/guava/2.8.2/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/snc/mid/19.0.0.0/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/azure/local/azure-core-http-okhttp/1.11.6/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/snc/commons-core-automation/19.0.0.0/commons-core-automation-19.0.0.0.pom"
rm -rf "$HOME/.m2/repository/com/snc/snc-automation-api/19.0.0.0/snc-automation-api-19.0.0.0.pom"
rm -rf "$HOME/.m2/repository/com/snc/commons-glide/19.0.0.0/commons-glide-19.0.0.0.pom"
rm -rf "$HOME/.m2/repository/com/google/code/gson/gson/2.8.2/gson-2.8.2.pom"
rm -rf "$HOME/.m2/repository/com/google/guava/guava/2.8.2/guava-2.8.2.pom"
rm -rf "$HOME/.m2/repository/com/snc/mid/19.0.0.0/mid-19.0.0.0.pom"
rm -rf "$HOME/.m2/repository/com/azure/local/azure-core-http-okhttp/1.11.6/azure-core-http-okhttp-1.11.6.pom"
- name: Build with Maven
run: mvn -V -B package --file pom.xml
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}