This repository contains the Maven libraries that I created. They're hosted on GitHub Packages. Here's the full list.
Below are the instructions to use them in your Java project.
This is a one-time setup to use any Maven artifact from GitHub Packages.
You must create a Personal Access Token (PAT), with at least the read:packages
scope.
It is required to install any library from GitHub Packages, even if it's public.
Add your credentials to GitHub Packages in your settings.xml
file:
<!-- settings.xml -->
<settings>
<servers>
<server>
<id>github-packages</id> <!-- you'll use the same ID in your pom.xml -->
<username>${YOUR_GITHUB_USERNAME}</username> <!-- for example: axel-op -->
<password>${YOUR_GITHUB_PAT}</password>
</server>
</servers>
</settings>
jobs:
your-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '11'
server-id: github-packages # you'll use the same ID in your pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- run: mvn test # or whatever command you want to run
env:
MAVEN_USERNAME: ${{ secrets.GITHUB_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.GITHUB_PAT }}
Create secrets to encrypt your username and your PAT.
For more complex workflows, use the maven-settings-action.
Add a reference to this repository in your pom.xml
:
<!-- pom.xml -->
<project>
<repositories>
<repository>
<id>github-packages</id> <!-- use the same id as in the previous step -->
<name>axel-op Maven libraries</name>
<url>https://maven.pkg.github.com/axel-op/maven-packages</url>
</repository>
</repositories>
</project>
You can now add a dependency to any Maven artifact in this repository! For example:
<!-- pom.xml -->
<project>
<dependencies>
<dependency>
<groupId>fr.axelop.agnosticserverlessfunctions</groupId>
<artifactId>agnostic-serverless-functions-interfaces</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>