[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[egit-dev] Fwd: Problem cloning authenticated repository usign a PSF file
|
Background:
I'm tasked with automating the setup of our Git repositories and
associated projects in our Eclipse workspace. I started out trying to
use a team project set file but hit some hurdles so then tried to start
automating using EGit/JGit APIs but ran into similar hurdles. Would
anyone have some guidance that might help? We have multiple projects in
our Git repositories and need to clone repositories that are both
authenticated and public.
Details:
First, I'm having a problem when trying to clone and import projects
from a Git repository when using a PSF file. If the git repository I'm
using is not authenticated it works without a problem, the repository
gets cloned and the projects get imported into my workspace. The problem
is when the repository is authenticated, in that case when I'm importing
the PSF via File -> Import -> Team -> Team Project Set, I get prompted
for the credentials of the repo, but the username is hardcoded with my
system user, the textfield is read-only so I cannot change the user to
be the correct one. When doing similar testings using plain JGit to
clone the repository I got similar results, even when I'm setting the
credentials before calling the clone function it fails to connect and
the error message exposed that it's using the system user instead of the
one I manually provide. The JGit code I was trying was:
Git git = new Git(repository);
CloneCommand clone = git.cloneRepository();
clone.setBare(false);
clone.setCloneAllBranches(true);
clone.setDirectory(PATH).setURI(url);
UsernamePasswordCredentialsProvider user = new
UsernamePasswordCredentialsProvider(login, password);
clone.setCredentialsProvider(user);
clone.call();
Thanks in advance for any assistance you can provide! I greatly
appreciate it!
Héctor Romero