-2
       [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/thoughtworks/qdox/qdox/2.0-M9/qdox-2.0-M9.jar (317 kB at 9.9 MB/s)
       [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.8.4/plexus-compiler-javac-2.8.4.jar (21 kB at 734 kB/s)
       [INFO] Changes detected - recompiling the module!
       [INFO] Compiling 9 source files to /tmp/build_18ad8db2/target/classes
       [INFO] ------------------------------------------------------------------------
       [INFO] BUILD FAILURE
       [INFO] ------------------------------------------------------------------------
       [INFO] Total time:  14.502 s
       [INFO] Finished at: 2021-08-18T12:06:15Z
       [INFO] ------------------------------------------------------------------------
       [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project E-commerce: Fatal error compiling: invalid target release: 10 -> [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

The source codes are below, what do you think could be the problem?

https://github.com/furkannzmnn/ders

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Furkan Özmen
  • 21
  • 3
  • 6

1 Answers1

0

Try to add a file named system.properties in the project root containing the line

java.runtime.version=11

The stacktrace says that your target release is invalid:

  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project E-commerce: Fatal error compiling: invalid target release: 10 -> [Help 1]

Indeed Heroku does not support java 10 as runtime version, see more here.

vincendep
  • 528
  • 4
  • 10