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

Erro Build Maiven

Ola,

esta dando erro na hora do build utilizando o Maiven

Console Output Started by user Jean Silva Running as SYSTEM Building in workspace /Users/jean/.jenkins/workspace/teste-leiao The recommended git tool is: NONE No credentials specified

git rev-parse --resolve-git-dir /Users/jean/.jenkins/workspace/teste-leiao/.git # timeout=10 Fetching changes from the remote Git repository git config remote.origin.url https://github.com/rcaneppele/leilao.git # timeout=10 Fetching upstream changes from https://github.com/rcaneppele/leilao.git git --version # timeout=10 git --version # 'git version 2.32.0 (Apple Git-132)' git fetch --tags --force --progress -- https://github.com/rcaneppele/leilao.git +refs/heads/:refs/remotes/origin/ # timeout=10 git rev-parse refs/remotes/origin/master^{commit} # timeout=10 Checking out Revision 56beab8d5544b28c9827b967061c730922903d4e (refs/remotes/origin/master) git config core.sparsecheckout # timeout=10 git checkout -f 56beab8d5544b28c9827b967061c730922903d4e # timeout=10 Commit message: "codigos da aula 4" git rev-list --no-walk 56beab8d5544b28c9827b967061c730922903d4e # timeout=10 [teste-leiao] $ mvn clean test FATAL: command execution failed java.io.IOException: error=2, No such file or directory at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) at java.base/java.lang.ProcessImpl.(ProcessImpl.java:340) at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107) Caused: java.io.IOException: Cannot run program "mvn" (in directory "/Users/jean/.jenkins/workspace/teste-leiao"): error=2, No such file or directory at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071) at hudson.Proc$LocalProc.(Proc.java:252) at hudson.Proc$LocalProc.(Proc.java:221) at hudson.Launcher$LocalLauncher.launch(Launcher.java:995) at hudson.Launcher$ProcStarter.start(Launcher.java:507) at hudson.Launcher$ProcStarter.join(Launcher.java:518) at hudson.tasks.Maven.perform(Maven.java:368) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:806) at hudson.model.Build$BuildExecution.build(Build.java:198) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:514) at hudson.model.Run.execute(Run.java:1888) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432) Build step 'Invoke top-level Maven targets' marked build as failure Finished: FAILURE

2 respostas

Fiz esses steps quase foi. - https://www.metahat.net/2019/05/cannot-run-program-mvn-in-directory.html.

deu erro no final

Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.8.4/plexus-compiler-api-2.8.4.jar (27 kB at 47 kB/s) 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 36 kB/s) Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.8.4/plexus-compiler-manager-2.8.4.jar (4.7 kB at 7.8 kB/s) [INFO] Changes detected - recompiling the module! [INFO] Compiling 24 source files to /Users/jean/.jenkins/workspace/teste-leiao/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: 01:40 min [INFO] Finished at: 2022-02-03T11:52:13-03:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project leilao: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [ERROR] [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 Build step 'Invoke top-level Maven targets' marked build as failure Finished: FAILURE

solução!

Apos pesquisar, vi que faltava o java jdk no Mac.. após instalar o mesmo o build rodou lindamente!!!