I m unable to build my code in Jenkins Getting the error shown below

+1 vote
Commit message: "Update README.md" > C:\Users\eztrias\AppData\Local\Programs\Git\cmd\git.exe rev-list --no-walk 7ed2f12a939fbd7a5581fda906ede37e06099feb # timeout=10 [compile] $ cmd.exe /C '""C:\Program Files (x86)\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\Maven_Latest\bin\mvn.cmd"' compile && exit %%ERRORLEVEL%%" 
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.123 s
[INFO] Finished at: 2020-08-01T15:56:40+05:30
[INFO] Final Memory: 6M/243M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Program Files (x86)\Jenkins\workspace\compile). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
Aug 1, 2020 in Jenkins by Ashutosh
• 130 points
Hey @Ashutosh, did you solve this error? What helped bro?

2 answers to this question.

0 votes

Hey @Ashutosh, 

This error indicates that you tried to execute a goal that requires a POM but Maven didn't find a pom.xml file in the directory you invoked it from. 

In most cases, fixing this is merely a matter of changing the current directory in the command prompt to point at your project's base directory. If you don't want to change the current directory, you have to tell Maven explicitly where the POM to build resides like this:

mvn -f path/to/pom.xml <goals> ...

So the resolution for this is you need to give correct path to pom.xml file

Hope this helps!

answered Aug 3, 2020 by Sirajul
• 58,990 points
0 votes

Hi, @Ashutosh,

Do you have a pom.xml in this folder that you call mvn install-install-file? Look for the location of pom.xml in your project. Seems bitbucket assumes your pom.xml is an inside folder  (C:\Program Files (x86)\Jenkins\workspace\compile).

path_to_pom.xml is relative from  (C:\Program Files (x86)\Jenkins\workspace\compile).

answered Aug 3, 2020 by Gitika
• 65,870 points

Related Questions In Jenkins

0 votes
1 answer

unable to compile java code in Jenkins

If the code is compiling and running ...READ MORE

answered Apr 25, 2018 in Jenkins by DareDev
• 6,890 points
+2 votes
5 answers
0 votes
1 answer

How do I pass value from my Fake # script to the host build server (Jenkins)

You can use the EnvInject plugin to pass environment ...READ MORE

answered Jul 11, 2018 in Jenkins by Kalgi
• 2,680 points
0 votes
1 answer

Getting below error on Jenkins while creating a Maven Build Job

When you are using ssh to connect, ...READ MORE

answered Sep 3, 2019 in Jenkins by Hari
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 votes
1 answer
0 votes
1 answer
+1 vote
3 answers

How to auto build a job in jenkins if there is any change in code on Github repository?

To automatically run build on code commit, follow ...READ MORE

answered Jul 31, 2019 in Jenkins by Sirajul
• 58,990 points