Skip to content

How to allow unauthorised read access to GitHub packages maven repository? #26634

Answered by jcansdale
mstyura asked this question in Packages
Discussion options

You must be logged in to vote

For example, if I clone some project which rely on dependencies hosted on GitHub Packages maven repo I’ll fail to compile it. Will have to investigate what the heck is going on. Figure out that I need to register on GitHub. Then generate token. Store in in ~/.m2/settings.xml . And only then the project might compile.

There are a few thing you can do to make this a little less painful.

  1. Create a settings.xml file at the root of your repository
  2. Create a .mvn/maven.config file that contains -s settings.xml
  3. Generate a PAT with just the read:packages scope

If your repository is private, you can place the PAT directly in your settings.xml file. If your repository is public, you can’t push t…

Replies: 39 comments 19 replies

Comment options

You must be logged in to vote
1 reply
@aSemy
Comment options

Comment options

You must be logged in to vote
4 replies
@nbrugger-tgm
Comment options

@Siedlerchr
Comment options

@glelouet
Comment options

@pmeister
Comment options

Comment options

You must be logged in to vote
1 reply
@pmdevita
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@jdsalasca
Comment options

@glelouet
Comment options

@glelouet
Comment options

@glelouet
Comment options

@Autuan
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@pmeister
Comment options

Comment options

You must be logged in to vote
5 replies
@Siedlerchr
Comment options

@jo-elimu
Comment options

@tr7zw
Comment options

@jo-elimu
Comment options

@lagergren
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Packages Host your dependencies, libraries, and production-ready code, right from your repository Product Feedback npm Tagging to track for future npm category