Reputation: 393
I am using wagon-git 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?
Upvotes: 1
Views: 628
Reputation: 31
We have to add username, password, and HTTP Basic Auth in Maven settings.xml to fetch and pull from bitbucket/Github private repository.
<servers>
<server>
<id>your-repo-id</id>
<username>yourgithubusername</username>
<password>yourgithubpassword</password>
</server>
<configuration>
<httpHeaders>
<property>
<name>Authorization</name>
<value>BASIC-AUTH HEADER VALUE</value>
</property>
</httpHeaders>
</configuration>
</servers>
</settings>```
Upvotes: 1