Why when i try push my Spring boot app to heroku it return "Fatal error compiling: invalid target release: 11"

Hugo Vinicius :

I'm trying to push my Spring boot app to Heroku, but i'm get this error below.

[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

! ERROR: Failed to build app with Maven We're sorry this build is failing! If you can't find the issue in application code, please submit a ticket so we can help: https://help.heroku.com/ ! Push rejected, failed to compile Java app. ! Push failed

I checked the JAVA_HOME, java -version, java -version and mvn -version all points to the same java version: 11.0.3

My POM.xml:

<?xml version="1.0" encoding="UTF-8"?>

https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot spring-boot-starter-parent 2.2.5.RELEASE com.hugo.algamoney-api algamoney-api 1.0.0-SNAPSHOT algamoney-api Workshop Spring Boot com mongodb

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

Hugo Vinicius :

problem solved! After a lot of try and error it works, i will post below the steps that i take:

  1. Change the entire project to java 11, for some reassy the JRE of the project whas in the 1.8 version;
  2. Create a system.properties whitch the follow Configuration: java.runtime.version=11.0.3;
  3. Commit and add push again to heroku;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

when i try to register by my app i didn't get any respnse

missing return statement when I run my app in Android Studio

Why is my Spring Boot app with SQS Not Showing a JMSHealthIndicator?

Unresolvable circular reference when I try to create the bean for SessionFactory with Spring Boot

Why am I getting a NameError when I try to access an attribute in my class?

Why when I try to use PDO::PARAM_STR in Slim3, Slim return an error?

Why am I getting an 'undefined' when I try to call my function?

My app is crashing when I try to go to another activity

Why is 'state' undefined when I try to display user input in final step of React app?

My react app is not working when i push it into production in heroku, Cannot GET /

Send email with Spring Boot app in Heroku

Thymeleaf + Spring Boot. I try to make dynamic fields, but when the button is pressed nothing happens at all

Why will the command not be sent to my DMs when I try and use it on my server

Why am I getting a '400: Bad Request' when i try to change my Discord avatar?

Why does the MS sample C# app for WMI fail when I try it?

Why my app keep opening when I use shortcut in Python?

Why If I upload a picture Spring Boot searches in my computer?

Why is my list empty when i try to read it

Failed to compile values file' when i try to run my app

Why does it return undefined when I try to get the height and width of an image in react.js

Why my vuex store state chnage when i try to chnage the data using the method in my component?

Why i get build error when i try to open my android studio project?

When I start my spring boot application, my database is not initiating

Why my app crashes when I put the recycler view?

Why is this Warning showing when I try to debug my Flutter application

When I run spring boot test cases I got error I could not resolve on my own

Build failed when I try to run my flutter app

Heroku Fatal error compiling: invalid target release: 11

Why does my React app disappear when I run it

Heroku ReactJS app. Home route is functional, but when I try another route it shows up as 404 Not Found

TOP Ranking

HotTag

Archive