git 没有这样的文件:jenkins 中的“pom.xml”错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31157672/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 03:21:03  来源:igfitidea点击:

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

gitmavenjenkins

提问by Varun

I have a repository in Bitbucket. In that repository i have project called DemoWhich is a mavenproject. I am trying to deploy Demowith Jenkins.

我在Bitbucket. 在那个存储库中,我有一个名为Demowhich 是一个maven项目的项目。我正在尝试Demo使用Jenkins.

Steps I am following.

我正在遵循的步骤

  1. Created a job(Item) in Jenkins.
  2. Configure(This is the configuration for the individual jobs).

    Projectname: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.

  1. 在 Jenkins 中创建了一个工作(项目)。
  2. 配置(这是单个作业的配置)。

    项目名称:Demo。

    描述:bla bla bla ..

    源代码管理-> Git->存储库 URL:[email protected]:UserName/ProjectName.git。

    ->凭证:提供了我的凭证。

    构建-> 根 POM : pom.xml.

Everything looks fine but pom.xml throwing error saying :

一切看起来都很好,但 pom.xml 抛出错误说:

No such file: ‘pom.xml'

没有这样的文件:'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.

由于这是 maven 项目,它正在寻找 pom.xml,我在提供路径时感到困惑。因为 Jenkins 正在汇集来自 Bitbucket 的源代码,它在 Demo 项目下有 pom.xml。

But I do not know which path to provide here.

但我不知道在这里提供哪条路径。

回答by prudviraj

If you have your pom.xml in your workspace then use below command in ROOT POM.

如果您的工作区中有 pom.xml,则在 ROOT POM 中使用以下命令。

$workspace\pom.xml

回答by Hilal H Muhammed

You have to mention the path of your application's pom.xml in relation to jenkins work space.

您必须提及与 jenkins 工作空间相关的应用程序 pom.xml 的路径。

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.

一旦 Jenkins 构建开始,它会将源代码下载到 .jenkins\jobs\yourjobname\workspace 并在那里构建它,如果您不确定 pom 路径,您可以检查此位置。

E.g For an application Test .jenkins\jobs\jenkinsJobName\workspace\Test\pom.xml

例如对于应用程序 Test .jenkins\jobs\jenkinsJobName\workspace\Test\pom.xml

The root pom field should be Test\pom.xml

回答by Rishi12

use $workspace\"Directory name where the pom.xml present"\pom.xml

使用 $workspace\"pom.xml 所在的目录名"\pom.xml