0

He estado empezando a ver un poco acerca de Spring-boot, ya pude crear una pequeña API pero se me presentó un inconveniente al momento de querer deployarlo, ya he estado buscando algunas posibles soluciones pero no pude resolver el problema. Al momento de cargar al repositorio de git de heroku me sale el siguiente error:

remote:        [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project proyectoTis: Fatal error compiling: invalid target release: 15 -> [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
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: fbd70804100be55265a85761def9ed0356619dcf
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version fbd70804100be55265a85761def9ed0356619dcf
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: !       Push rejected to proyecto-tis.
remote:
To https://git.heroku.com/proyecto-tis.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/proyecto-tis.git'
2
  • 1
    No conozco Heroku pero el error es claro: Fatal error compiling: invalid target release: 15. Estás intentando compilar tu proyecto de Maven con un JDK inferior al 15. Revisa la configuración del entorno donde estás haciendo esta compilación y indícale que use un JDK 15 o superior. el 13 may. 2021 a las 4:23
  • SI, pude solucionar el problema y tenia que ver con las versiones que estaba manejando localmente y la que utiliza Heroku. Gracias!
    – Gary Soliz
    el 13 may. 2021 a las 16:21

1 respuesta 1

0

En la carpeta raíz de tu proyecto debes crear un archivo llamado

system.properties

Este archivo es el que lee heroku para obtener configuraciones específicas para tu aplicación. Allí se debe indicar la versión de Java que tu apliación necesita, en una linea del archivo se coloca:

java.runtime.version=15

Esta información junto con las versiones de Java que soporta heroku se encuentran en: Soporte de java en heroku

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.