0

I'm trying to perform a mvn release:prepare command from a git bash console (on Windows 10) and I get the following error:

[ERROR] Permission denied, please try again.
[ERROR] git@gitlab.XXX.fr: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
[ERROR] fatal: Could not read from remote repository.
[ERROR]
[ERROR] Please make sure you have the correct access rights
[ERROR] and the repository exists.

Here's the build part of my pom.xml:

    <build>
            <finalName>${project.artifactId}</finalName>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-toolchains-plugin</artifactId>
                    <version>1.1</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>toolchain</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <toolchains>
                            <jdk>
                                <version>${maven.compiler.source}</version>
                            </jdk>
                        </toolchains>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>3.1.0</version>
                    <configuration>
                        <dependentWarExcludes>WEB-INF/lib/*</dependentWarExcludes>
                        <webResources>
                            <resource>
                                <directory>src/main/webapp</directory>
                                <!-- enable filtering -->
                                <filtering>true</filtering>
                                <includes>
                                    <include>META-INF/context.xml</include>
                                </includes>
                            </resource>
                            <resource>
                                <directory>src/main/webapp</directory>
                                <!-- enable filtering -->
                                <filtering>false</filtering>
                                <excludes>
                                    <exclude>META-INF/context.xml</exclude>
                                </excludes>
                            </resource>
                        </webResources>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.4.1</version>
                    <configuration>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                        <arguments>-Dmaven.javadoc.skip=true</arguments>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.shared</groupId>
                            <artifactId>maven-invoker</artifactId>
                            <version>2.2</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-scm-plugin</artifactId>
                            <version>1.8.1</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
            </plugins>
        </build>        
        <scm>         

<developerConnection>scm:git:ssh://git@gitlab.XXX.fr/YYY.git</developerConnection>
            <url>https://gitlab.XXX.fr/YYY</url>
            <tag>v5.1.31</tag>
        </scm>

The "funny" part is that when I perform a git push from the same console, it works. So the console knows my ssh key but Maven doesn't.

Edit: I forgot to mention that it used to work perfectly until I updated git to 2.39.

Thank you very much

Clément Picou
  • 4,011
  • 2
  • 15
  • 18

0 Answers0