1

I am trying to use maven-release-plugin:2.5.3.

My repository on github is working with ssh. Push and pull works fine.

When entering ssh -T git@github.com in Terminal I get the correct answer from github:

"Hi UserName! You've successfully authenticated, but GitHub does not provide shell access."

When entering ./mvnw release:prepare in Eclipse Terminal I get Build Success.

But when entering ./mvnw release:prepare in Eclipse Terminal I get the following Error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:perform (default-cli) on project ProjectName: Unable to checkout from SCM
[ERROR] Provider message:
[ERROR] The git-clone command failed.
[ERROR] Command output:
[ERROR] Cloning into '/Users/UserName/git/RepoName/ProjectName/target/checkout'...
[ERROR] remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
[ERROR] remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
[ERROR] fatal: unable to access 'https://github.com/UserName/RepoName.git/': The requested URL returned error: 403

My POM looks like this:

<scm>
    <developerConnection>scm:git:git@github.com:UserName/RepoName.git</developerConnection>
    <tag>HEAD</tag>
</scm>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
            <goals>install</goals>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            </configuration>
        </plugin>
    </plugins>
</build>

My ssh config file looks like this:

Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_ed25519

Host github.com
IdentityFile ~/.ssh/github/github_rsa

In Eclipse Preferences General->Network Connections->SSH2, I have the following private keys:

/Users/UserName/.ssh/github/github_rsa,id_dsa,id_rsa

And the SSH2 home:

/Users/UserName/.ssh

It looks as if GitHub was still trying to connect via https: but I don´t see how or where.

Any help appreciated.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
gdon
  • 21
  • 2

1 Answers1

0

First, make sure maven release is using the right private key.

Second, as long as you see:

fatal: unable to access 'https://github.com/UserName/RepoName.git/': 

No amount of SSH setting will work: if the remote repository is access through HTTPS, SSH key won't be used. At all.

You might want to set connection as well as developerconnection to an SSH URL, using the syntax:

scm:git:ssh://git@github.com/UserName/RepoName.git
        ^^^
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250