我正在尝试将我的Spring boot应用程序推到Heroku,但我在下面得到了这个错误。
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 41 source files to /tmp/build_4ad2779b666eb1cd25b32f96d104b00b/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.273 s
[INFO] Finished at: 2020-03-23T14:23:48Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project algamoney-api: Fatal error compiling: invalid target release: 11 -> [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
!错误:未能用Maven构建应用程序,我们很抱歉这个构建失败了!如果您在应用程序代码中找不到问题,请提交一张票证,以便我们提供帮助:https://help.heroku.com/!推送被拒绝,无法编译Java应用程序。!推送失败
我检查了JAVA_HOME、java-version
、java-version
和mvn-version
所有指向相同的java版本:11.0.3
我的pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<!-- Dependencia do hibernate e Jackson para funcionar o datatype -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-java8</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<!-- Pega a causa da exceção -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<scope>provided</scope>
</dependency>
<!-- Spring security -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.3.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.0.10.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<version>2.0.8</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<release>11</release>
</configuration>
</plugin>
</plugins>
</build>
问题解决了!经过大量的尝试和错误后,我将在下面发布我所采取的步骤:
system.properties
,包含以下配置:java.runtime.version=11.0.3
;当我运行这个命令时,我试图将我的后端应用程序部署到heroku bun 我得到这个错误 这是我的pom文件:
我在IntelliJ终端中运行mvn clean package时出现此错误: [错误]无法执行目标组织。阿帕奇。专家插件:maven编译器插件:3.6.1:项目保护编译(默认编译):致命错误编译:无效目标版本:1.8- 这是在告诉我它正试图用Java 1.8编译,还是它期望使用Java 1.8,但可用的版本不正确?
我试图在Eclipse中调试一个简单的java程序,结果出现了以下错误: 本机方法中的致命错误:JDWP未初始化任何传输,jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)错误:传输错误202:连接失败:连接超时错误:JDWPTransport dt_socket未能初始化,TRANSPORT_nit(510)JDWP退出错误AGENT_ERROR_TRANSPO
我使用Eclipse中的Spring仪表板创建项目。我也尝试过使用Spring初始化器创建它,并尝试了java的版本8和版本9,但我仍然得到了这个结果。还试图改变maven的目标。运行配置,maven构建使用JavaSE1。8,jre 1.8。0 命令:
我知道这个问题在这里已经被问了无数次了,我已经搜索了SO和其他来源来寻找解决方法,但我就是无法解决这个错误。我的ClientPlayer类属性有一个getter和setter,当某个按钮被调用时setter在GUI中被调用,我希望在客户端连接对象并将对象发送到服务器后使用getter。调用方法“This.client.SendTCP(ClientPlayer.GetPlayerName());”返
我正在尝试将本地Spring Boot应用程序连接到我的Heroku Postgres数据库。当我使用Heroku上可用的creds尝试此操作时,我得到以下错误 错误:SEVERITY_LOCALIZED=FATAL,SEVERITY_NON_LOCALIZED=FATAL, CODE=28000, MESSAGE=没有主机"myhost",用户"myuser",数据库"mydb"的pg_hba.