DEV Community

Discussion on: How to publish Maven packages to a single GitHub repository

Collapse
 
cmani97 profile image
Mani • Edited

Hi, I followed the same but getting the following errors. What is the issue? Please help.
"Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project demolibrary: Failed to deploy artifacts: Could not transfer artifact com.example:demolibrary:jar:3.0.2 from/to github (maven.pkg.github.com/-----/test-pl... authentication failed for maven.pkg.github.com/-----/test-pl..., status: 401 Unauthorized -> [Help 1]"
and
"Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project demolibrary: Failed to deploy artifacts: Could not find artifact com.example:demolibrary:jar:3.0.1 in github (maven.pkg.github.com/-------/test-...) -> [Help 1]"

Collapse
 
jakub_zalas profile image
Jakub Zalas

Looks like your github access token isn't valid or wasn't given the right scope. Make sure you've assigned write:packages scope.

Collapse
 
cmani97 profile image
Mani

Yes, I added that also. But still same error "status: 422 Unprocessable Entity".

Thread Thread
 
jakub_zalas profile image
Jakub Zalas

Feel free to review the repositories where it all works fine.

For example: github.com/vlingo/xoom-actors/

All vlingo xoom packages are published to github.com/vlingo/xoom-platform/pa...

Thread Thread
 
jakub_zalas profile image
Jakub Zalas

One other thing to check is if you're creating the artifact properly. Perhaps it's missing or something like that. see stackoverflow.com/questions/643221...