Skip to content

Commit

Permalink
workflows: maven
Browse files Browse the repository at this point in the history
  • Loading branch information
krishpranav committed Dec 21, 2024
1 parent 2cdd620 commit 96dcdd9
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@ name: Java CI with Maven

on:
push:
branches: [ "main" ]
branches:
- "main"
pull_request:
branches: [ "main" ]
branches:
- "main"

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 23 (or replace with your version)
uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'

- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
- name: Check out code
uses: actions/checkout@v4

- name: Install Java
run: |
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk
- name: Set JAVA_HOME
run: echo "JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64" >> $GITHUB_ENV

- name: Install Maven
run: |
sudo apt-get install -y maven
mvn -version
- name: Maven Clean Install
run: mvn clean install -U

- name: Maven Package
run: mvn package

0 comments on commit 96dcdd9

Please sign in to comment.