Giter VIP home page Giter VIP logo

java-maven-library-publisher's Introduction

Build and publish automatically your Java Maven Library to GitHub Packages and Maven Central.

GitHub action to build a Java Maven library and publish it to GitHub Packages and Maven Central.

Requirements

Configurations

GitHub secrets

Create your GitHub secrets on your repository:

  • NEXUS_USERNAME with your username used on Sonatype
  • NEXUS_PASSWORD with your password used on Sonatype
  • GPG_PRIVATE_KEY with the private key of your generated pgp key
    • to get the private key gpg --armor --export-secret-key <key-id> > privkey.asc
  • GPG_PASSPHRASE with the passphrase of your gpg key

pom.xml

Inside your pom.xml file you need to set:

For more details you can look pom-example.xml

Usage

The workflow, usually declared in .github/workflows/library-publish.yml, looks like:

name: Java library publisher
on:
  release:
    types: [created]
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - name: Maven Library build and publish
        uses: MathieuSoysal/[email protected]
        with:
          nexus-username: ${{ secrets.NEXUS_USERNAME }}
          nexus-password: ${{ secrets.NEXUS_PASSWORD }}
          gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
          gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
          github-token: ${{ secrets.GITHUB_TOKEN }}
          java-version: 17

Badge

image

Don't forget to add your own MavenCentral badges to your readme ๐Ÿ˜‰:

License

The Dockerfile and associated scripts and documentation in this project are released under the Apache 2.0 License.

java-maven-library-publisher's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

java-maven-library-publisher's Issues

Automatically customization

Problem

Currently, we need to manually customize the project and is so fastidious.

Solution

We can automatize this with GitHub Action that customize automatically the template with GitHub repository informations.

Add automated tests

Current problem

Currently, we don't have any automated tests inside the project. This is a little problematic for the contribution, a contributor can't test if the added feature works correctly.

Solution to fix this

It's probably possible to use https://github.com/nektos/act inside a CI, to execute this JavaDoc publisher with a empty project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.