【问题标题】:Error in heroku build: invalid target releaseheroku 构建中的错误:目标版本无效
【发布时间】:2021-05-30 11:03:05
【问题描述】:

当我插入命令 git push heroku master 以便在 eroku 中部署时,出现以下错误

fatal error compiling: invalid target release: 15 -> [Help 1]

以下是我的 pom.xml

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.4.3</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.wk</groupId>
    <artifactId>manager</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>manager</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>15</java.version>
    </properties>
    <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.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>2.0.1.Final</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <type>maven-plugin</type>
        </dependency>

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-boot-starter</artifactId>
            <version>3.0.0</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

我寻找了类似的问题,但没有解决我的问题 我什至在我的属性中添加了:

java.runtime.version=15

但是没用

为 jdk 15 更改了 maven 主页仍然无法正常工作

我正在按照本教程的步骤https://dashboard.heroku.com/apps/candidate-manager-api/deploy/heroku-git

我该如何解决这个问题?

【问题讨论】:

    标签: spring-boot heroku


    【解决方案1】:

    基于与此问题相关的someotheranswers

    您应该在项目的根目录中创建一个名为 system.properties 的文件,然后输入:

    java.runtime.version=15
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-06-05
    • 2012-02-18
    • 1970-01-01
    • 2014-03-08
    • 2018-08-03
    • 2015-06-01
    • 2020-01-28
    • 2020-12-27
    相关资源
    最近更新 更多