No such file: ‘pom.xml’ error in jenkins
Solution 1
You have to mention the path of your application's pom.xml in relation to jenkins work space.
Once Jenkins build starts it will download the source code to .jenkins\jobs\yourjobname\workspace and builds it there, you can check this location if you are not sure of the pom path.
E.g For an application Test .jenkins\jobs\jenkinsJobName\workspace\Test\pom.xml
The root pom field should be Test\pom.xml
Solution 2
If you have your pom.xml in your workspace then use below command in ROOT POM.
$workspace\pom.xml
Varun
Updated on July 09, 2022Comments
-
Varun almost 2 years
I have a repository in
Bitbucket
. In that repository i have project calledDemo
Which is amaven
project. I am trying to deployDemo
withJenkins
.Steps I am following.
- Created a job(Item) in Jenkins.
Configure(This is the configuration for the individual jobs).
Project name:Demo.
Description:bla bla bla..
Source Code Management -> Git -> Repository URL :[email protected]:UserName/ProjectName.git.
->Credentials: provided my credential.
Build-> Root POM :
pom.xml
.
Everything looks fine but pom.xml throwing error saying :
Since this is the maven project it is looking for pom.xml, and I am confuse while providing the path. since Jenkins is pooling source from Bitbucket, which have pom.xml under Demo project.
But I do not know which path to provide here.
-
chao over 8 yearsthat solved my problem, but for unix like systems should be a forward slash $workspace/pom.xml