Configuring Apache Maven for use with GitHub Packages

You can configure Apache Maven to publish packages to GitHub Packages and to use packages stored on GitHub Packages as dependencies in a Java project.

It solves to return the data type in micro service model when call the others services.

You can follow by steps:

* Build

- Step 1: Authenticating to GitHub Packages

You use a personal access token with the appropriate scopes to publish and install packages in GitHub Packages.

- Step 2: create new file or edit file (if it exist) setting.xml


+ Ubuntu/Linux: vim ~/.m2/settings.xml

+ Win: path:\Users\user\.m2\setting.xml (c:\Users\JVMD\.m2\settings.xml)

<settings xmlns=""


          <name>GitHub OWNER Package1 Maven Packages</name>

      <username>your username in github</username>
      <password>your personal access token</password>

- Step 3: Publishing a package

In your project, edit pom.xml file. 

     <name>GitHub OWNER Package1 Maven Packages</name>

- Step 4: deploy

mvn deploy

* Installing a package:

- Step 1: go to your project and edit pom.xlm file


- Step 2: run

mvn install


Done. It's simple.

Share this

Related Posts

Next Post »