3

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();
Diego Arena
  • 134
  • 10

1 Answers1

2

The documentation says to use the token as a password.

Adriaan
  • 17,741
  • 7
  • 42
  • 75