gpt4 book ai didi

maven 发布插件失败

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

当我尝试做的时候:

> maven release:prepare

我得到一个错误:

release:prepare error

我试图将 mvn.cmd 更改为 mvn.bat 但没有帮助:

" Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project sfg-pet-clinic: Failed to invoke Maven build. Error configuring command-line. Reason: Maven executable not found at: C:\Program Files\JetBrains\IntelliJ IDEA 2018.1.1\plugins\maven\lib\maven3\bin\mvn.bat"

下面是我的 maven 构建的痕迹

> "C:\Program Files\Java\jdk1.8.0_181\bin\java.exe"
> -Dmaven.multiModuleProjectDirectory=C:\Users\Charles\Desktop\kurs\sfg-pet-clinic
> "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA
> 2018.1.1\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA
> 2018.1.1\plugins\maven\lib\maven3\bin\m2.conf" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA
> 2018.1.1\lib\idea_rt.jar=64828:C:\Program Files\JetBrains\IntelliJ IDEA 2018.1.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program
> Files\JetBrains\IntelliJ IDEA
> 2018.1.1\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2018.1.1
> org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare -f pom.xml
>
> [INFO] Scanning for projects...
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] Reactor Build Order:
>
> [INFO]
>
> [INFO] sfg-pet-clinic
>
> [INFO] pet-clinic-data
>
> [INFO] pet-clinic-web
>
> [INFO]
>
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] Building sfg-pet-clinic 0.0.1
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO]
>
> [INFO] --- maven-release-plugin:2.3.2:prepare (default-cli) @
> sfg-pet-clinic ---
>
> [INFO] Resuming release from phase 'run-preparation-goals'
>
> [INFO] Executing goals 'clean verify'...
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] Reactor Summary:
>
> [INFO]
>
> [INFO] sfg-pet-clinic ..................................... FAILURE [
> 2.356 s]
>
> [INFO] pet-clinic-data .................................... SKIPPED
>
> [INFO] pet-clinic-web ..................................... SKIPPED
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] BUILD FAILURE
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] Total time: 3.110 s
>
> [INFO] Finished at: 2018-09-18T13:51:01+02:00
>
> [INFO] Final Memory: 17M/228M
>
> [INFO]
> ------------------------------------------------------------------------
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare
> (default-cli) on project sfg-pet-clinic: Failed to invoke Maven build.
> Error configuring command-line. Reason: Maven executable not found at:
> C:\Program Files\JetBrains\IntelliJ IDEA
> 2018.1.1\plugins\maven\lib\maven3\bin\mvn.bat -> [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/MojoExecutionException
>
>
>
> Process finished with exit code 1

POM

    <?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>

<groupId>guru.springframework</groupId>
<artifactId>sfg-pet-clinic</artifactId>
<version>0.0.1</version>
<modules>
<module>pet-clinic-data</module>
<module>pet-clinic-web</module>
</modules>
<packaging>pom</packaging>

<name>sfg-pet-clinic</name>
<description>SFG Pet Clinic Project</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>

<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>
</configuration>
</plugin>
</plugins>
</build>

</project>

在maven之后可以在命令行找到我已经尝试从终端执行,但仍然失败

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project sfg-pet-clinic: U
nable to tag SCM
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] Host key verification failed.
[ERROR] fatal: Could not read from remote repository.
[ERROR]
[ERROR] Please make sure you have the correct access rights
[ERROR] and the repository exists.
[ERROR]
[ERROR] -> [Help 1]
[ERROR]

enter code here

最佳答案

我知道这是一个非常古老的问题,但我遇到了同样的问题。

我对我的机器的访问受到限制,所以我不能使用 cmd、Powershell 或 Bash 终端来做所有事情。所以我必须使用 IntelliJ 让它工作。

只是强调一下,我同意所有这些好的评论:更喜欢使用已安装的 mvn 终端,本地测试版本/版本:更新等。

但是,您的问题的答案隐藏在您的调试 错误 日志中。

> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare
> (default-cli) on project sfg-pet-clinic: Failed to invoke Maven build.
> Error configuring command-line. Reason: Maven executable not found at:
> C:\Program Files\JetBrains\IntelliJ IDEA
> 2018.1.1\plugins\maven\lib\maven3\bin\mvn.bat

在 Windows 机器上,IntelliJ 创建一个可执行文件 mvn.cmd。因此,只需创建该 mvn.cmd副本,并将其另存为 mvn.batrename mvn.cmdmvn.bat

尽管这将运行您的 Maven 发布插件,您仍然需要设置 scm 标签。

关于maven 发布插件失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52386453/

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