Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

HTTPS Git credentials aren't filled from Maven settings #42

Open
nickcmaynard opened this issue Sep 26, 2016 · 6 comments
Open

HTTPS Git credentials aren't filled from Maven settings #42

nickcmaynard opened this issue Sep 26, 2016 · 6 comments

Comments

@nickcmaynard
Copy link

nickcmaynard commented Sep 26, 2016

We're attempting to do the following:

    <repository>
      <id>maven-releases</id>
      <name>My Maven Repo</name>
      <url>git:releases://https://github.com/username/repo.git</url>
    </repository>

Yep - that's an HTTPS URL. If the HTTPS Git credentials are cached by Git, then everything works very well.

Sadly, in a CI environment (like Jenkins) we don't have the ability to manipulate the Git credentials cache - at which point the user (Jenkins) is asked for the username and password.

And this, obviously, fails the build.

Now, having set up the username and password in the Maven settings, the information is available to Maven. Unfortunately, this plugin doesn't use the information.

Sadly we can't do the obvious thing and use SSH. We're on a managed Jenkins instance, and don't have access to underlying filesystem. Incidentally, the same reason we can't pre-seed git-credentials with the information.

Does anyone have any ideas?

@mschonaker
Copy link
Owner

Have you already tried .netrc file? It happens that wagon-git uses gitexe
provider which, in turn, uses the git client installed in your system.
That's why I'd give it a try.

Regards.

On Sep 26, 2016 14:16, "Nick Maynard" notifications@github.com wrote:

We're attempting to do the following:

<repository>
  <id>maven-releases</id>
  <name>My Maven Repo</name>
  <url>git:releases://https://github.com/username/repo.git</url>
</repository>

Yep - that's an HTTPS URL. If the HTTPS Git credentials are cached by Git,
then everything works very well.

Sadly, in a CI environment (like Jenkins) we don't have the ability to
manipulate the Git credentials cache - at which point the user (Jenkins) is
asked for the username and password.

And this, obviously, fails the build.

Now, having set up the username and password in the Maven settings, the
information is available to Maven. Unfortunately, this plugin doesn't
use the information.

We can't do the obvious thing and use SSH because, we're on a managed
Jenkins instance, and don't have access to underlying filesystem/credential
storage.

Does anyone have any ideas?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#42, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWESYWX82eTuJV524j9V1iaq-vCWDt6ks5qt_3-gaJpZM4KGxiy
.

@nickcmaynard
Copy link
Author

Hey, thanks for getting back to me. For the same reason as we can't update the .ssh/ directory, or pre-seed git credentials, we don't have access to .netrc.

@nickcmaynard
Copy link
Author

I did notice the concept of a Git credentials provider, along with the GIT_ASKPASS environment variable... but that would, I think, involve code on the part of this plugin.

@mschonaker
Copy link
Owner

Have you tried providing the user and password in the URL? Just like in this SO answer.

@nickcmaynard
Copy link
Author

While that may work, it's undesirable as we then bake credentials into the POM. Each of our developers has individual creds, and we have many POMs... We'd then need to make sure they were stripped before committing the POM to source control...

You get the idea. Sadly we can't run with that.

@tuxedo0801
Copy link

I have exactly the same issue.
Tried the same with bitbucket repo with http access.
The documentation says, that one can set private access credentials in settings.xml:
http://synergian.github.io/wagon-git/bitbucket.html

I checked the source-code. I can't see any access to maven settings.xml :-(
@mschonaker How does this work?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants