8000 GitHub - ahmed82/GitHub-packages
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ahmed82/GitHub-packages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

GitHub-packages

GitHub-package For Maven project

  1. check the maven setting file
mvn --version
mvn help:effective-settings

If not exist create your own from https://maven.apache.org/settings.html

  1. Update Maven setting.xml from GitHub doc https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry

  2. Create a token (required)

image

For the New personal access token image

Add the newly generated token in your Maven setting.xml file

image

  1. Update the pom.xml file located in the project.
<distributionManagement>
   <repository>
     <id>github</id>
     <name>GitHub OWNER Apache Maven Packages</name>
     <url>https://maven.pkg.github.com/OWNER/REPOSITORY</url>
   </repository>
</distributionManagement>
  1. Add packaging to package the library
<packaging>jar</packaging>
  1. Add Maven plugin compiler to compile the code

Installing a package

TBD

Create a workflow for automation

This step auto-deploys the package once the code change is pushed/merged

  • create new folders .github/workflows
  • Create publish-java-maven.yml
  • Required new secret used your token
name: Publish package to GitHub Packages
on: push
jobs:
  publish:
    runs-on: ubuntu-latest 
    permissions: 
      contents: read
      packages: write 
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-java@v3
        with:
          java-version: '11'
          distribution: 'adopt'
      - name: Publish package
        run: mvn --batch-mode deploy
        env:
          GITHUB_TOKEN: ${{ secrets.JAVA_TOKEN }}

Java Action workflow:

https://github.com/actions/setup-java

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0