简体   繁体   English

Jenkins 无法识别 git 子目录

[英]Jenkins not recognizing the git sub-directory

I am new to Jenkins, just trying to build/run my first Spring boot application.我是 Jenkins 的新手,只是想构建/运行我的第一个 Spring 启动应用程序。

This is my sample git repository url, which I am trying to load in to Jenkins.这是我的示例 git 存储库 url,我正在尝试将其加载到 Jenkins。

https://github.com/LogeshLohit/thymeleaf-sb-test.git 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]"当我尝试构建应用程序时,它会抛出此错误“[错误]您指定的目标需要执行一个项目,但此目录中没有 POM (D:\Program Files\Jenkins_new\workspace\path1)。请验证您从正确的目录调用 Maven。-> [帮助 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.在我的本地存储库中,项目位于“D:\Program Files\Jenkins_new\workspace\path1\thymeleaf-test”,但 jenkins 只查看“D:\Program Files\Jenkins_new\workspace\path1”(来自日志)我猜。

How can I make Jenkins to look one folder down, so that it will find the pom.xml in its sub-directory?如何让 Jenkins 向下查看一个文件夹,以便在其子目录中找到 pom.xml?

In the invoke top-level maven target step, click Advanced...在调用顶级 maven 目标步骤中,单击高级...
POM [ rel_path/to/pom.xml ] POM [ rel_path/to/pom.xml ]
relative to workspace root.相对于工作区根。 In your case, that's thymeleaf-test/pom.xml在你的情况下,这是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). -f,--file <arg>强制使用备用 POM 文件(或带有 pom.xml 的目录)。

That's a freestyle project, building with "invoke top-level maven targets" and goal as "compile"这是一个自由式项目,使用“调用顶级 maven 目标”和“编译”目标构建

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" :您至少可以指定 pom.xml 的完整路径(或评论的相对路径),如“如何使用 Jenkins 执行 Maven 项目”中所示

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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