我使用Heroku "Java Getting Started"模板在Heroku上创建了一个应用程序:https://github.com/heroku/java-getting-started . 它工作正常 .
后来我决定使用Java 1.7而不是1.8 . 所以我在 system.properties
中设置了 java.runtime.version=1.7
,并在我的pom.xml中的 properties
下设置了 java.version
.
不幸的是现在它没有编译(它使用Maven) . 当我推送到Heroku时,它会下载一堆Maven依赖项,然后死掉以下错误:
[错误]无法在项目myservice上执行目标org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:build-info(默认):目标org.springframework.boot的执行默认值:spring- boot-maven-plugin:2.0.0.RELEASE:build-info failed:无法在插件'org.springframework.boot中加载mojo'build-info':spring-boot-maven-plugin:2.0.0.RELEASE '由于API不兼容:org.codehaus.plexus.component.repository.exception.ComponentLookupException:org / springframework / boot / maven / BuildInfoMojo:不支持的major.minor版本52.0 [ERROR] ---------- ------------------------------------------- [ERROR] realm = plugin> org.springframework.boot: spring 启动了Maven插件:2.0.0.RELEASE
我知道错误消息的"unsupported major.minor version"组件是Java 1.7和Java 1.8之间的区别,但我不知道有些插件需要Java 1.8才能运行吗?我'm not really sure, but I haven' t在我的pom.xml中为我的 org.springframework.boot
依赖项指定了一个版本 .
1 回答
该示例使用Spring Boot 2.0,它不支持Java 7 .