简体   繁体   中英

Jenkins : Unable to Run Local Maven Project through Jenkins

I am new to CI. I am trying to run my local Selenium Project through Jenkins but it is getting failed with error. Here are the complete details:

OS - MAC OS local POM xml Path:

Users/prakuma/git/NaveenPOMProject/Naveen_HybridPOM/pom.xml

I am not sure why is /Users/Shared/Jenkins/Home/workspace/Naveen_POMHybrid getting added before my pom.xml path.

I am attaching screen shot of Configuration and Global Setting of Jenkins.

  1. Maven Global 在此处输入图片说明
  2. Global setting : 在此处输入图片说明
  3. Error: 在此处输入图片说明

For working with maven jenkins plugin to use local project which is outside jenkins workspace. You can use Copy Data To Workspace Plugin which will move the code to workspace before maven execution.

Give your project folder to in path to folder variable.

Now in Root pom , simply leave it empty or just give pom.xml.

To make Jenkins find the pom.xml in a custom workspace ...

  1. set the jobs Root POM to pom.xml
  2. set Use custom workspace with the path to your pom.xml (eg /Users/prakuma/git/NaveenPOMProject/Naveen_HybridPOM/ in this case)

在此处输入图片说明

Please follow the steps given below, which helped me to execute pom.xml successfully through jenkins on macOS.

  1. Click on configuration (of project in jenkins)
  2. Click on Build tab.
  3. Keep Root POM as pom.xml
  4. click on Advance.
  5. search for "Use custom workspace"
  6. check "Use custom workspace" , under Directory give your git dir location where pom.xml is there (eg: /Users/username/git/TestProject/TestProject).
  7. Save.
  8. Give all permission to directory(eg: /Users/username/git/TestProject)

Please click here to get the image

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM