Solucionado (ver solução)
Solucionado
(ver solução)
3
respostas

Erro ao tentar executar o comando

C:\Users\eduar>mvn -v
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T10:51:42-03:00)
Maven home: C:\apache-maven-3.2.2\bin\..
Java version: 1.8.0_231, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jre1.8.0_231
Default locale: pt_BR, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"
C:\Users\eduar>cd desktop\enviadoremail

C:\Users\eduar\Desktop\enviadorEmail>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building enviadorEmail 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.5.2/maven-install-plugin-2.5.2.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.5.2/maven-install-plugin-2.5.2.pom (7 KB at 7.8 KB/sec)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ enviadorEmail ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ enviadorEmail ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\Users\eduar\Desktop\enviadorEmail\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.053 s
[INFO] Finished at: 2019-11-19T14:18:47-03:00
[INFO] Final Memory: 13M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project enviadorEmail: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [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/MojoFailureException
C:\Users\eduar\Desktop\enviadorEmail>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building enviadorEmail 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ enviadorEmail ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ enviadorEmail ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\Users\eduar\Desktop\enviadorEmail\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.367 s
[INFO] Finished at: 2019-11-19T14:21:33-03:00
[INFO] Final Memory: 12M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project enviadorEmail: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [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/MojoFailureException
3 respostas

Oi amigo, tudo bem?

Você instalou a JDK na sua máquina? Parece que está tentando compilar usando JRE.

O comando abaixo retorna o que?

javac -version

Você me deu uma ótima dica. ao colocar esse comando apareceu ('javac' não é reconhecido como um comando interno ou externo, um programa operável ou um arquivo em lotes.)

Instalei o jdk, associei ele ao maven e ao tentar instalar deu outro erro ( package org.junit.jupiter.api does not exist).

dei uma olhada no codigo e substitui por import org.junit.Test; e na hora de instalar até que foram algumas coisas, mas deu outro erro.

Results :

Tests in error:
br.com.alura.enviadorEmail.enviadorEmail.EnviadorEmailApplicationTests.initializationError(br.com.alura.enviadorEmail.enviadorEmail.EnviadorEmailApplicationTests)
  Run 1: EnviadorEmailApplicationTests.initializationError »  The class br.com.alura.en...
  Run 2: EnviadorEmailApplicationTests.initializationError »  Test class should have ex...
  Run 3: EnviadorEmailApplicationTests.initializationError »  Method contextLoads() sho...


Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.890 s
[INFO] Finished at: 2019-11-19T16:42:51-03:00
[INFO] Final Memory: 22M/311M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project enviadorEmail: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\eduar\Desktop\enviadorEmail\target\surefire-reports for the individual test results.
[ERROR] -> [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/MojoFailureException
solução!

Encontrei o erro. estava na class EnviadorEmailApplicationTests que foi criado automaticamente. Ao exclui-la, consegui instalar normalmente pelo cmd com o comando mvn install. :)

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software