Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,294,687
Community Members
 
Community Events
165
Community Groups

Maven cannot authenticate to Bitbucket to download artifacts from private repo

Edited

I have a private Maven repo in my BitBucket account that I had been using for years until I let that project slide. I wanted to do more work on it but I found that the 1.0 API had changed. I figured out the new 2.0 API URL but now Maven will not connect.

 

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.014 s
[INFO] Finished at: 2021-08-20T17:31:34-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project hanfastolfe-accounts: Could not resolve dependencies for project com.hanfastolfe:hanfastolfe-accounts:jar:2.1.0-alpha: Failed to collect dependencies at com.hanfastolfe:hanfastolfe-misc:jar:1.0.0: Failed to read artifact descriptor for com.hanfastolfe:hanfastolfe-misc:jar:1.0.0: Could not transfer artifact com.hanfastolfe:hanfastolfe-misc:pom:1.0.0 from/to han_fastolfe_maven_repository_releases (https://api.bitbucket.org/2.0/repositories/Bytor/maven_repository/src/releases): Authorization failed for https://api.bitbucket.org/2.0/repositories/Bytor/maven_repository/src/releases/com/hanfastolfe/hanfastolfe-misc/1.0.0/hanfastolfe-misc-1.0.0.pom 403 Forbidden -> [Help 1]

 

I have verified that with curl -u … I can download the files using the same credentials set in my ~/.m2/settings.xml file for Maven.

What do I need to do to make sure that Maven can once again download artifacts?

1 answer

0 votes
Mark C Atlassian Team Aug 31, 2021

Hi @Bytor

Thank you for reaching out to the community.

Would it be possible for you to confirm how you're using the credentials from ~/.m2/settings.xml?
Are you currently using environment variables?

You can also try to do a Curl command before your build command to see if Curl will also work on Pipelines or not.

Apart from that, I'd also recommend testing your Pipelines build locally in a Docker container to compare if it works there or not.
Ideally, if it works locally in a Docker container, it should also work on Pipelines.

Let me know how it goes.

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,159 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you