Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No such file: ‘pom.xml’ error in jenkins

Tags:

git

maven

jenkins

I have a repository in Bitbucket. In that repository i have project called Demo Which is a maven project. I am trying to deploy Demo with Jenkins.

Steps I am following.

  1. Created a job(Item) in Jenkins.
  2. 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 :

No such file: ‘pom.xml’

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.

like image 977
Varun Avatar asked Jul 01 '15 09:07

Varun


People also ask

How do I set the root pom in Jenkins?

In the Build Triggers section, there are multiple options, select the required one. Add the pom. xml file's path in the Root POM option. Configure the other fields as per your requirement and then click on the Save button.

What is the use of POM xml in Jenkins?

What is a POM? A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project. It contains default values for most projects.


Video Answer


1 Answers

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
like image 139
Hilal H Muhammed Avatar answered Oct 11 '22 01:10

Hilal H Muhammed