Java mvn发布时无法将文件提交到github:在spring引导中准备

Java mvn发布时无法将文件提交到github:在spring引导中准备,java,git,maven,spring-boot,maven-release-plugin,Java,Git,Maven,Spring Boot,Maven Release Plugin,请指导我在进行mvn发布时如何进一步操作:在我的spring boot项目中进行准备。如果需要,请告诉我如何将ssh密钥添加到我的项目中。 我尝试了很多解决方案,但都没有成功,因为每次都会显示相同的错误,这是我基于模块化方法的项目,我使用的IDE是IntelliJ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release- plugin:2.5.3:prepare (default-cli) on project

请指导我在进行mvn发布时如何进一步操作:在我的spring boot项目中进行准备。如果需要,请告诉我如何将ssh密钥添加到我的项目中。 我尝试了很多解决方案,但都没有成功,因为每次都会显示相同的错误,这是我基于模块化方法的项目,我使用的IDE是IntelliJ

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release- plugin:2.5.3:prepare (default-cli) on project vj-pet-clinic: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] git@github.com: Permission denied (publickey).
[ERROR] fatal: Could not read from remote repository.
[ERROR] Please make sure you have the correct access rights
[ERROR] and the repository exists.
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
我的pom.xml文件是:-

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<modules>
    <module>pet-clinic-data</module>
    <module>pet-clinic-web</module>
</modules>
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.2.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.vinamra</groupId>
<artifactId>vj-pet-clinic</artifactId>
<version>0.0.1</version>
<name>vj-pet-clinic</name>
<description>VJ pet clinic project</description>

<properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>
</dependencies>

<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>
                <checkModificationExcludes>
                    <checkModificationExclude>pom.xml</checkModificationExclude>
                </checkModificationExcludes>
            </configuration>
        </plugin>
    </plugins>
</build>

<scm>
  <developerConnection>scm:git:git@github.com:username/repository.git</developerConnection>
  <tag>vj-pet-clinic-0.0.1</tag>

4.0.0
聚甲醛
宠物诊所数据
宠物诊所网站
org.springframework.boot
spring启动程序父级
2.1.2.1发布
com.vinamra
vj宠物诊所
0.0.1
vj宠物诊所
VJ宠物诊所项目
1.8
org.springframework.boot
springbootmaven插件
org.apache.maven.plugins
maven发布插件
2.5.3
安装
pom.xml
scm:git:git@github.com:username/repository.git
vj-pet-clinic-0.0.1


请帮助我如何使用maven发布插件。

您可以使用HTTPS而不是SSH来避免密钥交换。以下是一个例子:

  <scm>
        <url>https://github.com/(username)/(repo)</url>
        <connection>scm:git:https://github.com/(username)/(repo).git</connection>
  </scm>

https://github.com/(用户名)/(回购协议)
scm:git:https://github.com/(用户名)/(回购).git

相应地替换
(用户名)
(repo)

您是先创建git存储库的吗?问题在这里:
git@github.com:权限被拒绝(公钥).
…@khmarbaise您能告诉我问题是什么,我该如何解决它吗???@EugenCovaci是的,我的存储库已经存在,并且已经有4次提交了