Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 4

401 Unhautorized when creating package with maven

Solved! Go to Solution.

Hi,
I have this error:
`"Failed to retrieve remote metadata org.dpsoftware:FastScreenCapture:1.0.1-SNAPSHOT/maven-metadata.xml: Could not transfer metadata org.dpsoftware:FastScreenCapture:1.0.1-SNAPSHOT/maven-metadata.xml from/to github (https://maven.pkg.github.com/sblantipodi/JavaFastScreenCapture): Authentication failed for https://maven.pkg.github.com/sblantipodi/JavaFastScreenCapture/org/dpsoftware/FastScreenCapture/1.0.... 401 Unauthorized"`

 

when I try to create a maven package from ci.

 

I have this in the pom.xml

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/sblantipodi/JavaFastScreenCapture</url>
</repository>
</distributionManagement>

 

 

but then in CI when I try to do this:

- name: Publish package
run: mvn -B deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

 

I got the error.

 

can you help me please?

3 Replies
Highlighted
Copilot Lvl 3
Message 2 of 4

Re: 401 Unhautorized when creating package with maven

I succeded in uploading the first 1.0.0-SNAPSHOT the first time, but now it don't want to get other packages. No care what version I use.

 

Is this a bug?

Highlighted
Copilot Lvl 3
Message 3 of 4

Re: 401 Unhautorized when creating package with maven

Highlighted
Solution
Copilot Lvl 3
Message 4 of 4

Re: 401 Unhautorized when creating package with maven

I'm sorry it was my fault, I forgot to import java before the mvn deploy :/