gpt4 book ai didi

java - Maven - 无法执行目标 org.apache.maven.plugins :maven-compiler-plugin:3. 7.0:使用 java 10 进行编译

转载 作者:行者123 更新时间:2023-12-02 09:18:16 27 4
gpt4 key购买 nike

我正在尝试使用 Git bash 将我的不和谐机器人项目上传到 Heroku我的项目是 java 10,我使用 Maven,但我收到此错误:

remote:        [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project bot_discord: Fatal error compiling: invalid flag: --release -> [Help 1]
remote: [ERROR]
remote: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote: [ERROR]
remote: [ERROR] For more information about the errors and possible solutions, please read the following articles:
remote: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
remote:
remote: ! ERROR: Failed to build app with Maven
remote: We're sorry this build is failing! If you can't find the issue in application code,
remote: please submit a ticket so we can help: https://help.heroku.com/
remote:
remote: ! Push rejected, failed to compile Java app.
remote:
remote: ! Push failed

我想我需要在我的 Pom.xml 中添加一些东西,但我不明白要添加什么!我的 pom.xml :

<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>kino.bot</groupId>
<artifactId>bot_discord</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Bot Ryo</name>
<description>Mon bot</description>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<release>10</release>
</configuration>
</plugin>
</plugins>
</build>


<repositories>
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>3.7.1_422</version>
</dependency>
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.4.9</version>
</dependency>
</dependencies>

</project>

我需要在 pom.xml 中添加什么?

最佳答案

确保存储库的根目录中有 system.properties 文件,其中包含以下内容:

java.runtime.version=10

有关更多信息,请参阅 Heroku documentation on Java versions

关于java - Maven - 无法执行目标 org.apache.maven.plugins :maven-compiler-plugin:3. 7.0:使用 java 10 进行编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52350260/

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