Erro Maven

25 views
Skip to first unread message

Edson F. Cunha

unread,
May 12, 2020, 3:38:59 PM5/12/20
to jenkinsci-br
Estou com o seguinte problema estou tentando compilar um jar utilizando CI/DC no jekins mais da este erro no maven:

Iniciado pelo usuário Edson F. Cunha
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/workspace/CI-CD-Pipeline-Homologação
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Clone)
[Pipeline] git
No credentials specified
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/efcunha/cicdproject-master.git # timeout=10
 > git --version # timeout=10
 > git fetch --tags --progress https://github.com/efcunha/cicdproject-master.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse refs/remotes/origin/dev^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/dev^{commit} # timeout=10
Checking out Revision d414e5a07aab1e6dffb9527ff6e27dcff858d0e8 (refs/remotes/origin/dev)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f d414e5a07aab1e6dffb9527ff6e27dcff858d0e8 # timeout=10
 > git branch -a -v --no-abbrev # timeout=10
 > git branch -D dev # timeout=10
 > git checkout -b dev d414e5a07aab1e6dffb9527ff6e27dcff858d0e8 # timeout=10
Commit message: "Initial commit"
First time build. Skipping changelog.
[Pipeline] tool
[Pipeline] sh
+ git log -n 1 --pretty=format:%h
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Test)
[Pipeline] sh
+ /opt/java/maven/bin/mvn test
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< com.br.marcelosv.cicd:cicdproject >------------------
[INFO] Building cicdproject 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ cicdproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/CI-CD-Pipeline-Homologação/src/main/resources
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/CI-CD-Pipeline-Homologação/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ cicdproject ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ cicdproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/CI-CD-Pipeline-Homologação/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ cicdproject ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ cicdproject ---
[INFO] No tests to run.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.054 s
[INFO] Finished at: 2020-05-12T11:29:18-04:00
[INFO] ------------------------------------------------------------------------
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Install)
[Pipeline] sh
+ /opt/java/maven/bin/mvn -B -DskipTests clean package
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< com.br.marcelosv.cicd:cicdproject >------------------
[INFO] Building cicdproject 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ cicdproject ---
[INFO] Deleting /var/lib/jenkins/workspace/CI-CD-Pipeline-Homologação/target
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ cicdproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/CI-CD-Pipeline-Homologação/src/main/resources
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/CI-CD-Pipeline-Homologação/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ cicdproject ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ cicdproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/CI-CD-Pipeline-Homologação/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ cicdproject ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ cicdproject ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:3.1.2:jar (default-jar) @ cicdproject ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /var/lib/jenkins/workspace/CI-CD-Pipeline-Homologação/target/cicdproject.jar
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.1.6.RELEASE:repackage (repackage) @ cicdproject ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.529 s
[INFO] Finished at: 2020-05-12T11:29:29-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.6.RELEASE:repackage (repackage) on project cicdproject: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.6.RELEASE:repackage failed: Unable to find main class -> [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:
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE

Diego Rafael

unread,
May 12, 2020, 7:27:30 PM5/12/20
to jenkin...@googlegroups.com
O primeiro passo seria simular este problema em um ambiente local, reproduzindo as mesmas configurações (maven, java), e o comando executado para compilação neste ambiente.

Pela mensagem de falha, aparentemente falta a configuração para definir a class a ser chamada quando o jar for executado.


--
Você recebeu essa mensagem porque está inscrito no grupo "jenkinsci-br" dos Grupos do Google.
Para cancelar inscrição nesse grupo e parar de receber e-mails dele, envie um e-mail para jenkinsci-br...@googlegroups.com.
Para ver essa discussão na Web, acesse https://groups.google.com/d/msgid/jenkinsci-br/8c27afac-7e22-4f9a-b89b-607a33ee3afd%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages