0
votes

I've created jenkins job which need to build something very simple

Clone this repo

https://github.com/g0t4/jenkins2-course-spring-boot

cd to project

https://github.com/g0t4/jenkins2-course-spring-boot/tree/master/spring-boot-samples/spring-boot-sample-atmosphere

and run mvn compile

inside the atmosphere there is a pom.xml file, so what could be the reason to no finding it ?

I've configure the task like following

enter image description here

enter image description here

The error in the log is:

Checking out Revision 4bde91e33e2860b2aab142028c04eff37b7791f2 (refs/remotes/origin/master)

git config core.sparsecheckout # timeout=10 git checkout -f 4bde91e33e2860b2aab142028c04eff37b7791f2 Commit message: "Adding in jacoco code coverage" First time build. Skipping changelog. [atmo_local] $ mvn -f spring-boot-samples/spring-boot-sample-atmosphere/pom.xml complie FATAL: command execution failed java.io.IOException: error=2, No such file or directory

update

When I click on my mac mvn -v I get

Apache Maven 3.3.9 (bb52d2b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T18:41:47+02:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"

update 2 this is the global configuration

enter image description here

enter image description here

1
try adding the -X flag to maven (verbose mode) (I can't see your screenshots from here, but the flag will help)spi
@spi - thanks, where I should add it ? , in the goals ?user6124024
in the place where you configure the maven command. maybe in the job, or globally in the settingsspi
ho! isnt there a typo here? complie instead of compile?spi
@RaynD no since I don't have Jenkins at work and I even can't see your screenshots (they are firewalled). But the procedure should be quite strait forward: 1) install java 2) install maven 3) register them in $PATH, so you can launch java -version and mvn -v without errors and 4) configure jenkins to run mvn clean installspi

1 Answers

0
votes

I've installed the latest jenkins with maven plugin . this is not sufficient ?

No, it's not. You have to also configure Maven location to jenkins.

The steps are something like:

  1. Click Manage Jenkins
  2. Click Global Tool Configuration
  3. In the JDK section click Add JDK button, uncheck Install automatically checkbox and enter Name and JAVA_HOME values to point to right locations
  4. In the Maven section click Add Maven button, uncheck Install automatically checkbox and enter Name and MAVEN_HOME value (whatever it is in your jenkins system)
  5. Click Apply and then Save