Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Maven cannot authenticate to Bitbucket to download artifacts from private repo

Bytor
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 20, 2021

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
Atlassian Team members are employees working across the company in a wide variety of roles.
August 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
AUG Leaders

Atlassian Community Events