reposilite: Deploy fails with 401 Unauthorized

settings.xml:

      <server>
         <id>my-snapshots</id>
         <username>desktop</username>
         <password>ez4vAMSvCmzGORZYWqWe/si6J4kKstgpIVoVFtOGz15G6yPjNM++PuMtyumoilo/</password>
     </server>

pom.xml:

      <distributionManagement>
          <snapshotRepository>
              <id>my-snapshots</id>
              <url>http://192.168.10.4:8100/snapshots/</url>
          </snapshotRepository>
      </distributionManagement>

Reposilite console:

02:04:26.924 INFO | Generated new access token for desktop (/) with 'w' permissions
02:04:26.925 INFO | ez4vAMSvCmzGORZYWqWe/si6J4kKstgpIVoVFtOGz15G6yPjNM++PuMtyumoilo/
02:04:26.938 INFO | Stored tokens: 1
02:05:03.381 INFO | LOOKUP /snapshots/de/XXX/YYY/ZZZ/41-SNAPSHOT/maven-metadata.xml from 192.168.10.2
02:05:03.490 INFO | DEPLOY /snapshots/de/XXX/YYY/ZZZ/41-SNAPSHOT/AAA-41-20201205.010503-1.pom from 192.168.10.2

mvn deploy:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project AAA: Failed to deploy artifacts: Could not transfer artifact XXX.YYY.ZZZ:AAA:pom:41-20201205.010503-1 from/to my-snapshots (http://192.168.10.4:8100/snapshots/): Transfer failed for http://192.168.10.4:8100/snapshots/de/XXX/YYY/ZZZ/41-SNAPSHOT/AAA-41-20201205.010503-1.pom 401 Unauthorized -> [Help 1]

Not sure what I’m doing wrong here - login with the token via the web UI works. Any hints?

Please tell me if you need more info. Thank you.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 39 (29 by maintainers)

Commits related to this issue

Most upvoted comments

Okay, I’m dumb. I specified the credentials in ~/dev/maven/settings.xml NOT in ~/m2/settings.xml. Was trying from cli all the time, where I did not pass it via -s and/or -gs. So it was just not picked up. Usually I configure Eclipse/IntelliJ to use the settings.xml in ~/dev/maven/.

In the Authentication tutorial you even explicitly say to put it in ~/m2/.

Sorry, my bad! Thanks for your help!

Haha, no problem 😅 Configurations are always full of some static properties that are easy to misspell and sometimes it’s hard to investigate the source of problem. I’m glad it’s finally working and I wish you luck with your projects 😃

After some debugging, we found the problem - my version of Maven embedded in the Eclipse plugin didn’t deploy correctly, but a globally-installed version did. Not sure why - but what’s important is that it works now 😃

Hang on - I didn’t remove the previous Docker image version. It might not be an authentication problem. But we’ll see…

So it’s definitely something with authentication, because it’s handled slightly differently and I forgot to log that part too 🤦 I’m quite tired today as it was a long day, I’ll make the last one commit and I’m going to sleep, so I hope it’ll solve the mystery.

Got the same error, tried to investigate for an hour straight, then realised I’ve made a typo:

/critalix/ as cristalix with 'r' permissions

Anyway thank you for supporting reposilite, dzikoysk ฅ^•ﻌ•^ฅ