gpt4 book ai didi

java - maven 版本 :prepare for Spring Boot 2. 3.1.RELEASE 的问题

转载 作者:行者123 更新时间:2023-12-04 01:20:03 25 4
gpt4 key购买 nike

我有一个项目,父级如下:

    <parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.RELEASE</version>
</parent>

和以下插件:

    <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>
<autoVersionSubmodules>true</autoVersionSubmodules>
<releaseProfiles>release</releaseProfiles>
<tagNameFormat>@{project.version}</tagNameFormat>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.8.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

当我尝试制作 mvn -DpreparationGoals=clean release:prepare 时失败并显示此消息:

[INFO] Executing: /bin/sh -c cd /root/.jenkins/workspace/Eureka-Client_Pipeline_develop && git push ssh://will:*******@github.com/spring-projects/spring-boot.git/PGXperts-Eureka-Client develop:develop
[INFO] Working directory: /root/.jenkins/workspace/Eureka-Client_Pipeline_develop
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.459s
[INFO] Finished at: Tue Jul 07 14:34:14 CEST 2020
[INFO] Final Memory: 16M/536M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project PGXperts-Eureka-Client: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
[ERROR] Host key verification failed.
[ERROR] fatal: Could not read from remote repository.

对于错误消息的第一行,我注意到它正在尝试推送到 github 而不是我的 git 存储库,当我使用 spring-boot-starter 时,这一步没有问题-parent 2.2.7.RELEASE。我想也许问题可以通过更新插件的版本来解决,但我测试了版本 3.0.0-M1 for maven-release-plugin1.11.2 for maven-scm-插件,我得到了同样的错误。这个错误是因为这个版本吗?如果是,我应该选择哪些版本?这可能是 spring-boot-starter-parent 的错误?

最佳答案

有一个 small regression在 Spring Boot 2.3.0 和 2.3.1 中,这意味着您的项目将从 spring-boot-starter-parent 继承更多的东西。这包括有关项目源代码管理 (SCM) 的信息,我怀疑这就是推送到错误位置的原因。

Spring Boot reference documentation显示您应该覆盖以避免继承它们的元素。如果您使用的是 Spring Boot 2.3.1 或 2.3.0,则需要进行一些额外的覆盖。这些添加使完整的集合看起来像下面这样:

<description/>
<url/>
<organization/>
<issueManagement/>
<developers>
<developer/>
</developers>
<licenses>
<license/>
</licenses>
<scm>
<connection/>
<developerConnection/>
<url/>
</scm>

添加上述内容,或在发布时升级到 Spring Boot 2.3.2,应该可以恢复 Spring Boot 2.2 的行为。

关于java - maven 版本 :prepare for Spring Boot 2. 3.1.RELEASE 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62777650/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com