"No such file:" error in jenkins when integrating with Maven build
<p>I have recently started using Jenkins as a CI tool for my Maven Selenium automation project.</p>

<p>The path of my local eclipse workspace is:</p>

<pre><code>/media/user/Data/Automation_Scripts
</code></pre>

<p>and the complete path of the <code>pom.xml</code> file used to execute the project is: </p>

<pre><code>/media/user/Data/Automation_Scripts/[project_name]/pom.xml
</code></pre>

<p>Now, I have installed Jenkins and added a Maven project to it. When I try to enter the path my project's <code>pom.xml</code> file in the 'Root POM' text field under 'Build' I get following error:</p>

<pre><code>No such file: ‘/media/user/Data/Automation_Scripts/test/pom.xml’
</code></pre>

<p><a href="https://i.stack.imgur.com/wu7WK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wu7WK.png" alt="error_message_section"></a></p>

<p>Whereas if I navigate to the same path the <code>pom.xml</code> file is present. When I build the Maven project in Jenkins, following error is shown:</p>

<pre><code>Started by user Test Building in workspace
/var/lib/jenkins/jobs/TEST/workspace Parsing POMs ERROR: No such file
/media/user/Data/Automation_Scripts/test/pom.xml Perhaps you need to
specify the correct POM file path in the project configuration?
Finished: FAILURE
</code></pre>

<p><strong>Update:</strong> </p>

<p>I created a pom.xml file in my jenkins workspace which is located at:</p>

<pre><code>/var/lib/jenkins/jobs/TEST/workspace
</code></pre>

<p>In this pom file have given path of my actual pom.xml (which is located in another folder) in the following way:</p>

<pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
&lt;name&gt;Maven Default Project&lt;/name&gt;
&lt;artifactId&gt;jenkins_test&lt;/artifactId&gt;  

&lt;parent&gt;
&lt;groupId&gt;ca.test&lt;/groupId&gt;
  &lt;artifactId&gt;maven_test&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;relativePath&gt;/media/user/Data/Automation_Scripts/test/pom.xml&lt;/relativePath&gt;
 &lt;/parent&gt;
&lt;/project&gt;
</code></pre>

<p><br>Still I am getting following error now:</p>

<pre><code>Building in workspace /var/lib/jenkins/jobs/TEST/workspace
Parsing POMs
ERROR: Failed to parse POMs
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM: Could not find artifact ca.test:maven_test:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 9

at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:364)
at hudson.maven.MavenEmbedder.buildProjects(MavenEmbedder.java:361)
at hudson.maven.MavenEmbedder.readProjects(MavenEmbedder.java:331)
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1301)
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1098)
at hudson.FilePath.act(FilePath.java:1018)
at hudson.FilePath.act(FilePath.java:996)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.parsePoms(MavenModuleSetBuild.java:960)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:679)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1720)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Finished: FAILURE
</code></pre>

<p>I guess there is something wrong with the relative path. Can you tell me what I am missing here?</p>