Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use bitbucket access token with JGit instead of user / pass

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();
like image 657
Diego Arena Avatar asked Oct 20 '25 16:10

Diego Arena


1 Answers

The documentation says to use the token as a password.

like image 74
Csaba Skrabak Avatar answered Oct 23 '25 06:10

Csaba Skrabak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!