Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I use Bitbucket as private maven repository?

Welly Hong October 19, 2017

I tried to leverage Bitbucket as private maven repository for the gradle project. Below are steps I tried to setup in Bitbucket and gradle project.

Bitbucket 5.0.1:

1. Create a project "repo" in Bitbucket and enable project having public access with read only

2. Create a repository "maven-repo" in Bitbucket

3. Commit com/company/shared/utils/1.0/utils-1.0.jar to "maven-repo"

Gradle Project:

1. Add Bitbucket "maven-repo" in build.gradle

repositories {
mavenCentral()
        maven { url "http://bitbucketServer:9000/projects/REPO/repos/maven-repo/browse" }
}

2. Add utils-1.0.jar as dependency in build.gradle

dependencies {
             // http://bitucketServer:9000/projects/REPO/repos/maven-repo/browse
             compile 'com.company.shared:utils:1.0'
}

However, I got "Could not resolve: com.company.shared:utils:1.0". 

3 answers

2 votes
daniel_de_leon
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!
November 1, 2018

Try this:


https://jeroenmols.com/blog/2016/02/05/wagongit/

 

Sounds thats work, I will try it later.

1 vote
Harsha
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!
May 21, 2020

I am using http://synergian.github.io/wagon-git/bitbucket.html  version 0.2.5 to deploy and consume the artifact from my private bitbucket. Following the same steps as given in the documentation http://synergian.github.io/wagon-git/bitbucket.html.

Error:

`Could not resolve dependencies for project com.xxx:yyy:jar:1.0.0: The following artifacts could not be resolved: com.aaa:bbb:jar:3.0: Could not find artifact com.aaa:bbb:jar:3.0 in xxx_repo (https://api.bitbucket.org/2.0/repositories/company/xxx_repo/raw/releases)`

Research:

From my research, I found many suggested the problem in repository URL so I changed to
https://bitbucket.org/company/xxx_repo/raw/releases/ from this URL I am able to access the repo but the compilation fails with an error saying zip END header not found

`Compilation failure:
[ERROR] Error reading /home/msuser1/.m2/repository/com/aaa/bbb/3.0/bbb-3.0.jar; zip END header not found`

And too many warning saying checksum validation failed.

`[WARNING] Could not validate integrity of download from https://bitbucket.org/company/xxx_repo/raw/artifacts/com/aaa/bbb/3.0/bbb-3.0.jar: Checksum validation failed, expected <!doctype but is 2f947caee42a20633fb9c412ew53591f64b8c4481`

Solution:

**What is the exact URL for consuming the artifact from a private bitbucket?**

**Can anyone provide complete working steps to deploy and consume artifact from private bitbucket using wagon-git?**

illia.naumov
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!
May 12, 2023

Have you any progress with this?

1 vote
Deleted user April 7, 2018
Dainius Figoras
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!
February 14, 2021

By same logic we shouldn't use bb pipeline or anything else, because initially bb was designed to do only source control..

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events