简体   繁体   中英

Jenkins not recognizing the git sub-directory

I am new to Jenkins, just trying to build/run my first Spring boot application.

This is my sample git repository url, which I am trying to load in to Jenkins.

https://github.com/LogeshLohit/thymeleaf-sb-test.git

I checked-out the application like this, 在此处输入图像描述

While I am trying to build the application it throws this error "[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (D:\Program Files\Jenkins_new\workspace\path1). Please verify you invoked Maven from the correct directory. -> [Help 1]"

In my local repository the project is located at "D:\Program Files\Jenkins_new\workspace\path1\thymeleaf-test", but jenkins only looks at "D:\Program Files\Jenkins_new\workspace\path1"(from the logs) I guess.

How can I make Jenkins to look one folder down, so that it will find the pom.xml in its sub-directory?

In the invoke top-level maven target step, click Advanced...
POM [ rel_path/to/pom.xml ]
relative to workspace root. In your case, that's thymeleaf-test/pom.xml

I suppose it should also be possible to invoke using a command line option :
-f,--file <arg> Force the use of an alternate POM file (or directory with pom.xml).

That's a freestyle project, building with "invoke top-level maven targets" and goal as "compile"

You might at least specify the full path (or relative path, as commented) of the pom.xml, as seen in "How To Execute Maven Project Using Jenkins" :

https://www.softwaretestingmaterial.com/wp-content/uploads/2017/08/install-jenkins-14.png

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM