Skip to content

Maven Package

Maven Package #7

Workflow file for this run

# 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:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
env:
BYTEBUDDY_VERSION: 1.17.5
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
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: Download ByteBuddy agent for tests
run: mvn -B dependency:copy -Dartifact=net.bytebuddy:byte-buddy-agent:${{ env.BYTEBUDDY_VERSION }} -DoutputDirectory=target/test-agent -Dtransitive=false
- name: Build with Maven
run: mvn -B -DargLine="-javaagent=${{ github.workspace }}/target/test-agent/byte-buddy-agent-${{ env.BYTEBUDDY_VERSION }}.jar" package --file pom.xml
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml -DskipITs -DargLine="-javaagent=${{ github.workspace }}/target/test-agent/byte-buddy-agent-${{ env.BYTEBUDDY_VERSION }}.jar"
env:
GITHUB_TOKEN: ${{ github.token }}