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

35,435

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
Share:
35,435
Varun
Author by

Varun

Updated on July 09, 2022

Comments

  • Varun
    Varun almost 2 years

    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.

  • chao
    chao over 8 years
    that solved my problem, but for unix like systems should be a forward slash $workspace/pom.xml