Reputation: 136
I'm googling without any luck about how to use bitbucket access token instead of user / password with JGit client library.
The code below is about cloning a repo using a bitbucket user / pass.. How should I change this code to use bitbucket access token?
Git.cloneRepository()
.setURI("https://bitbucket.myserver.net/scm/d1app/mobile-testing-scenarios.git")
.setDirectory(new File("/home/darena/repo_download_path"))
.setCredentialsProvider(new UsernamePasswordCredentialsProvider("bitbucketUser", "bitbucketPass"))
.call();
Upvotes: 4
Views: 1802
Reputation: 41
If you are refering to Bitbucket personal access tokens, then the Csaba Skrabak's answer is correct.
If you are refering to repository/project/workspace access tokens, then I will say your question is similar to this one. I recommend you reading my answer.
Upvotes: 0