簡體   English   中英

在Maven構建期間,Jenkins Master無法在Jenkins從節點上找到pom.xml文件

[英]Jenkins Master cannot find pom.xml file on Jenkins Slave Node during Maven build

我有一個設置,其中存在一個

詹金斯大師 (jenkins-master)機器和詹金斯從節點 (jenkins-slave-one)。 從節點將編譯Maven項目。 這些項目是從Gitlab安裝中拉下來的。

在主端運行Jenkins作業時,在控制台中出現以下錯誤:

[錯誤]您指定的目標需要一個項目來執行,但是此目錄(/ var / jenkins / workspace / build-cc-restapi-dev)中沒有POM。 請驗證您是否從正確的目錄中調用了Maven。 -> [幫助1]

從Gitlab提取代碼工作正常。 只是pom.xml位於從節點/機器上的此處:

/var/jenkins/workspace/build-cc-restapi-dev/ccinfieldworkserver/pom.xml

請注意

The git cloning process is placing everything into:

=> /var/jenkins/workspace/build-cc-restapi-dev/ccinfieldworkserver
and not
=> /var/jenkins/workspace/build-cc-restapi-dev/

我該如何解決這個問題?

TIA

Started by user Jenkins Admin
Building remotely on ubuntu16.04-slave-one (build-maven-project) in workspace /var/jenkins/workspace/build-cc-restapi-dev
Cloning the remote Git repository
Cloning repository git@mylocalserver:CCININ/fieldwork-server.git
 > /usr/bin/git init /var/jenkins/workspace/build-cc-restapi-dev/ccinfieldworkserver # timeout=10
Fetching upstream changes from git@mylocalserver:CCININ/fieldwork-server.git
 > /usr/bin/git --version # timeout=10
using GIT_SSH to set credentials Using jenkins ID on Gitlab to fetch code from GITLAB
 > /usr/bin/git fetch --tags --progress git@mylocalserver:CCININ/fieldwork-server.git +refs/heads/*:refs/remotes/origin/*
 > /usr/bin/git config remote.origin.url git@mylocalserver:CCININ/fieldwork-server.git # timeout=10
 > /usr/bin/git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > /usr/bin/git config remote.origin.url git@mylocalserver:CCININ/fieldwork-server.git # timeout=10
Fetching upstream changes from git@mylocalserver:CCININ/fieldwork-server.git
using GIT_SSH to set credentials Using jenkins ID on Gitlab to fetch code from GITLAB
 > /usr/bin/git fetch --tags --progress git@mylocalserver:CCININ/fieldwork-server.git +refs/heads/*:refs/remotes/origin/*
 > /usr/bin/git rev-parse refs/remotes/origin/dev^{commit} # timeout=10
 > /usr/bin/git rev-parse refs/remotes/origin/origin/dev^{commit} # timeout=10
Checking out Revision 039b646001804b5fba636e514e85c9093a95ef5d (refs/remotes/origin/dev)
Commit message: "second change to see what happens"
 > /usr/bin/git config core.sparsecheckout # timeout=10
 > /usr/bin/git checkout -f 039b646001804b5fba636e514e85c9093a95ef5d
 > /usr/bin/git rev-list 039b646001804b5fba636e514e85c9093a95ef5d # timeout=10
[build-cc-restapi-dev] $ /opt/maven/bin/mvn clean package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.153 s
[INFO] Finished at: 2017-09-13T15:50:15+00:00
[INFO] Final Memory: 4M/10M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/var/jenkins/workspace/build-cc-restapi-dev). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR] 
[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] 
[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

沒關系,我發現我可以直接在“高級”功能下的“構建”->“調用頂級Maven目標”下指定pom.xml文件的位置。 TIA

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM