Skip to content

Latest commit

 

History

History
58 lines (47 loc) · 2.33 KB

README.md

File metadata and controls

58 lines (47 loc) · 2.33 KB

Hello GitHub Actions CI + Package Registry + Maven

Banner

This project is a sample how to deploy a Java Maven artifact with the brand new GitHub Actions CI to the GitHub Package Registry.
For now this feature is in beta. To use it, you have to # for the beta.

📦 The package is released here.

📚 You can find more info for Package Registry in the official GitHub doc:
Configuring Apache Maven for use with GitHub Package Registry

🔖 There is also an Example Project which shows how to add this dependency in maven project.

🛠 Add dependency

To include this sample dependency in you project you have to do two things:

  1. Add it as dependency in your pom.mxl.
<dependency>
    <groupId>github.tobsef</groupId>
    <artifactId>hello-maven</artifactId>
    <version>1.2.1</version>
</dependency>
<repositories>
    <repository>
        <id>github</id>
        <name>GitHub TobseF Apache Maven Packages</name>
        <url>https://maven.pkg.github.com/TobseF/HelloMaven</url>
        <releases><enabled>true</enabled></releases>
        <snapshots><enabled>true</enabled></snapshots>
    </repository>
</repositories>
  1. Add the authentication to the Package Registry to your global settings.xml:
    USER_HOME\.m2\settings.xml
<servers>
    <server>
        <id>github</id>
        <username>TobseF</username>
        <password>YOUR_AUTH_TOKEN</password>
    </server>
</servers>

Replace the YOUR_AUTH_TOKEN with a generated GitHub personal access token:
GitHub > Settings > Developer Settings > Personal access tokens > Generate new token:
The token needs at least the read:packages scope.

Setup your own

If you want to use the Package Registry in your own project, make sure its activated. Therefore check your project package site:
https://github.com/YOUR_NAME/YOUR_PROJECT/packages