1
votes

Échec de l'exécution de l'objectif org.maven.plugins: maven-compiler-plugin: 3.8.1: compile (default-compile) sur le projet (cible 11)

J'ai essayé de déployer l'application la plus simple des guides spring.io Guide

Mais j'ai quelques problèmes. Ce que j'ai fait:

  1. Projet créé. (du tutoriel spring.io)
  2. CLI heroku téléchargé
  3. Terminal ouvert dans IntellijIdea
    3.1 git init
    3.2 git add.
    3.3 git commit -m "fd"
    3.4 git remote ajouter heroke 'url'
    3.5 git push heroku master
  4. Après la dernière commande, j'ai cette erreur:
remote:        [INFO] BUILD FAILURE
remote:        [INFO] ------------------------------------------------------------------------
remote:        [INFO] Total time:  12.608 s
remote:        [INFO] Finished at: 2020-01-23T18:20:18Z
remote:        [INFO] ------------------------------------------------------------------------
remote:        [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project milliapp: Fatal error compiling: invalid target release: 11 -> [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: Verifying deploy...
remote:
remote: !       Push rejected to deploymilliapp.
remote:
To https://git.heroku.com/deploymilliapp.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/deploymilliapp.git'


0 commentaires

3 Réponses :


5
votes

Résolu. Supprimé cette partie du code

<properties>
<java.version>11</java.version>


0 commentaires

0
votes

Deuxième solution:

  1. Rétrograder l'application vers Java 8
  2. Utilisez maven-compiler-plugin 3.8.1 avec cette configuration:
   <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                    <testSource>8</testSource>
                    <testTarget>8</testTarget>
                    <showDeprecation>true</showDeprecation>
                    <compilerArgument>-Xlint:unchecked</compilerArgument>
                </configuration>
            </plugin>
        </plugins>


0 commentaires

0
votes

Dans le fichier pom.xml, commentez sous la ligne dans la balise properties.

<java.version>11</java.version>

Cela a fonctionné pour moi.


0 commentaires