trajano / wagon-git

Git wagon provider
Eclipse Public License 1.0
8 stars 10 forks source link

Credentials Problems #1

Closed kolotyluk closed 10 years ago

kolotyluk commented 10 years ago

Thank you so much for wagon-git, I was having so many problems with site-maven-plugin

However, when I try to use wagon-git I get

[INFO] --- maven-site-plugin:3.3:deploy (default-deploy) @ csharp-windows-elevate ---
[INFO] Parent project loaded from repository: org.sonatype.oss:oss-parent:pom:7
git:ssh://git@github.com/kolotyluk/csharp-windows-elevate.git?gh-pages#/ - Session: Opened
[INFO] Pushing D:\Users\Eric\Software\Project\Repositories\csharp-windows-elevate\target\site
[INFO]    >>> to git:ssh://git@github.com/kolotyluk/csharp-windows-elevate.git?gh-pages#/./
git:ssh://git@github.com/kolotyluk/csharp-windows-elevate.git?gh-pages#/ - Session: Disconnecting
git:ssh://git@github.com/kolotyluk/csharp-windows-elevate.git?gh-pages#/ - Session: Disconnected
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] csharp-windows-elevate ............................ FAILURE [8.783s]
[INFO] elevate-exe ....................................... SKIPPED
[INFO] elevate-mklink-exe ................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.094s
[INFO] Finished at: Sun Apr 13 09:04:18 PDT 2014
[INFO] Final Memory: 32M/1963M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:deploy (default-deploy) on project csharp-windows-elevate: Execution default-deploy of goal org.apache.maven.plugins:maven-site-plugin:3.3:deploy failed: ssh://git@github.com:22: org.eclipse.jgit.transp
ort.CredentialItem$StringType:Passphrase for C:\Users\Eric\.ssh\id_rsa -> [Help 1]

But I cannot see any problems in my ssh key configuration. I have been using the same configuration for years.

D:\Users\Eric\Software\Project\Repositories> ssh -T git@github.com
Warning: Permanently added 'github.com,192.30.252.131' (RSA) to the list of known hosts.
Hi kolotyluk! You've successfully authenticated, but GitHub does not provide shell access.

I have even created a new key-pair and tested it, and it works, but wagon-git gives me the same error.

Do you have any idea what the problems could be?

trajano commented 10 years ago

Seems like a setting problem in your Pom.xml. I suggest you look at the Pom.xml I use for the project to give you and example.

On Apr 13, 2014, at 12:33 PM, Eric Kolotyluk notifications@github.com wrote:

elevate

kolotyluk commented 10 years ago

There is a great deal of stuff in your pom.xml, so it is difficult to understand what is relevant. Also, it is different than what you published in your readme.ml, in particular, you refer to SNAPSHOT versions. My pom.xml is in https://github.com/kolotyluk/csharp-windows-elevate/blob/master/pom.xml and my settings has

    <server>
      <id>gh-pages</id>
      <username>kolotyluk</username>
      <password>ssh-passphrase</password>
    </server>

Is it possible to put more extensive diagnostic in wagon-git around this?

After making some more changes, I am still getting the same error.

trajano commented 10 years ago

I may be missing the capability to support password protected keys.

trajano commented 10 years ago

If there is anything wrong it would be around here.

    credentialsProvider = new UsernamePasswordCredentialsProvider(
            getAuthenticationInfo().getUserName(), getAuthenticationInfo()
                    .getPassword() == null ? "" //$NON-NLS-1$
                    : getAuthenticationInfo().getPassword());
    final Git git = Git.cloneRepository().setURI(gitRepositoryUri)
            .setCredentialsProvider(credentialsProvider)
            .setBranch(gitUri.getBranchName()).setDirectory(gitDir).call();
trajano commented 10 years ago

This should help in solving the problem: http://stackoverflow.com/a/17108882/242042

trajano commented 10 years ago

Just pushed 1782afb1ffaff517f3f787fe8e89fc6d4ee49a90 and evaluating to make sure it works before I release a new version. Would take a few days for me to do a proper test,

trajano commented 10 years ago

UGH WTF cygwin! line endings got borked.

trajano commented 10 years ago

Written the code now to test it out.

trajano commented 10 years ago

I pushed up a SNAPSHOT release with this fix see http://site.trajano.net/trajano/ on how to access the 1.0.1-SNAPSHOT of the wagon plugin.

I had been trying to get the "parent" reference to work correctly which is why a new release hasn't been made yet.

kolotyluk commented 10 years ago

Maven and Nexus are both conspiring against me. They are of the mind that I cannot have that artifact, and are teasing me about it. I can see the artifact in my nexus index, but nexus refuses to download it to its repository. For some reason the pom.xml is not in the index though.

trajano commented 10 years ago

seems to be there https://oss.sonatype.org/content/repositories/snapshots/net/trajano/wagon/wagon-git/1.0.1-SNAPSHOT/wagon-git-1.0.1-20140415.000703-2.pom

kolotyluk commented 10 years ago

Yes, I can see it there. I just cannot convince my local maven or nexus of that. I have manually copied the artifacts to my local repository, but maven refuses to look there, it only wants it from nexus. Nexus can be such a pain sometimes.

trajano commented 10 years ago

Did you add the sonatype-oss repository to your settings.xml as documented in http://site.trajano.net/trajano/

kolotyluk commented 10 years ago

Yes I did, but I think I am having other problems with my settings.xml. I am trying to troubleshoot it now...

kolotyluk commented 10 years ago

Could not find artifact net.trajano.wagon:wagon-git:jar:1.0.1-SNAPSHOT in apache.snapshots (http://repository.apache.org/snapshots)

Not sure why it is looking there. I disable my nexus, and have sonatype-oss in my settings.xml

I spend 5% of my time coding and 95% of my time hassling configuration files.

trajano commented 10 years ago

Well that's a WTF that it's going to apache.snapshots.

kolotyluk commented 10 years ago

I have nothing configured anywhere to look there, so maven must be looking there, and ignoring sonatype-oss.

kolotyluk commented 10 years ago

I give up. Can you push it to Maven Central?

I can see the artifacts in nexus, but nexus refuses to deliver them. When I take nexus out of the loop, then it will only look in apache-snapshots, and I have no idea why.

kolotyluk commented 10 years ago

OK, I solved the repo problem, and I am now downloading wagon-git-1.0.1-20140415.000703-2.jar

I forgot to put sonatype-oss in the public group on Nexus. However, I am still running into the same problem as before with

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:deploy (default-deploy) on project csharp-windows-elevate: Execution default-deploy of goal org.apache.maven.plugins:maven-site-plugin:3.3:deploy failed: ssh://git@github.com:22: org.eclipse.jgit.transp ort.CredentialItem$StringType:Passphrase for C:\Users\Eric.ssh\id_rsa -> [Help 1]

trajano commented 10 years ago

Make sure you remove the user name git from the settings XML. Only provide the password.

On Apr 15, 2014, at 10:11 AM, Eric Kolotyluk notifications@github.com wrote:

OK, I solved the repo problem, and I am now downloading wagon-git-1.0.1-20140415.000703-2.jar

I forgot to put sonatype-oss in the public group on Nexus. However, I am still running into the same problem as before with

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:deploy (default-deploy) on project csharp-windows-elevate: Execution default-deploy of goal org.apache.maven.plugins:maven-site-plugin:3.3:deploy failed: ssh://git@github.com:22: org.eclipse.jgit.transp ort.CredentialItem$StringType:Passphrase for C:\Users\Eric.ssh\id_rsa -> [Help 1]

— Reply to this email directly or view it on GitHub.

kolotyluk commented 10 years ago

OK, that worked, my site was uploaded to my gh_pages, but my modules do not work. When I look at the URL for my first module I see

http://kolotyluk.github.io/elevate.git%3Fgh-pages%23/index.html

which results in 404, page not found. During the build, my second module gets the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:deploy (default-deploy) on project elevate-mklink: Error uploading site: Invalid remote: origin: ssh://git@github.com/kolotyluk/elevate-mklink.git: ERROR: Repository not found. -> [Help 1]

I am using the same distributionManagement in my modules and parent POM.

  <distributionManagement>
    <site>
        <id>gh-pages</id>
        <name>Kolotyluk GitHub Pages</name>
        <url>git:ssh://git@github.com/kolotyluk/${project.artifactId}.git?gh-pages#</url>
    </site>
  </distributionManagement>
trajano commented 10 years ago

Yup I know it's a known problem with the module links. That's what's preventing me from making a new release. Although my module list does work. See site.trajano.net/app the parent project link is the only one not working.

On Apr 15, 2014, at 10:47 AM, Eric Kolotyluk notifications@github.com wrote:

OK, that worked, my site was uploaded to my gh_pages, but my modules do not work. When I look at the URL for my first module I see

http://kolotyluk.github.io/elevate.git%3Fgh-pages%23/index.html

which results in 404, page not found. During the build, my second module get the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:deploy (default-deploy) on project elevate-mklink: Error uploading site: Invalid remote: origin: ssh://git@github.com/kolotyluk/elevate-mklink.git: ERROR: Repository not found. -> [Help 1]

I am using the same distributionManagement in my modules and parent POM.

gh-pages Kolotyluk GitHub Pages git:ssh://git@github.com/kolotyluk/${project.artifactId}.git?gh-pages#

— Reply to this email directly or view it on GitHub.

kolotyluk commented 10 years ago

Wow, very nice site pages. Looks like you are using Jekyll. Did you create the skins yourself, or get them from somewhere?

I hope you can resolve the modules issue soon, as I would like to wrap up my project and deploy it to central :-)

trajano commented 10 years ago

Nope it's not Jekyll

As for the modules, I am not sure why it isn't working. The only thing I know I couldn't fix is the parent link.

On Wed, Apr 16, 2014 at 12:12 PM, Eric Kolotyluk notifications@github.comwrote:

Wow, very nice site pages. Looks like you are using Jekyll. Did you create the skins yourself, or get them from somewhere?

I hope you can resolve the modules issue soon, as I would like to wrap up my project and deploy it to central :-)

— Reply to this email directly or view it on GitHubhttps://github.com/trajano/wagon-git/issues/1#issuecomment-40618785 .

Archimedes Trajano www.trajano.net