简体   繁体   中英

Jenkins is not invoking the correct POM file after moving the source code to Gitlab if the pom is inside the multiple directory(A/B/C/pom.xml)

Recently we upgraded the Jenkins to 1.596.3 and everything was working fine. The source code version tool was mercurial. After few days we migrated the source code from Mercurial to git and then we installed the git plugin in Jenkins to connect to git repository and checkout the source code. We are able to checkout the source code successfully.The issue which appeared that is “ERROR: Failed to parse POMs”

Git client plugin 1.17.1 Git plugin 2.5.2 Git server plugin 1.6 Jenkins version 1.596.3

SOURCE CODE STRUCTURE trunk/HPAXXXXNav/
             |---ABC----|-------SRC AND POM.XML
             |---DEF----|--------SRC AND POM.XML
             |---POM.XML

They are calling the POM.XML file from Jenkins so the path is trunk/HPAXXXXNav/ABC/POM.XML

When I see the console log of the Jenkins it is throwing this error ERROR:

Failed to parse POMs
processing instruction can not have PITarget with reserveld xml name (position: START_DOCUMENT seen \r\n<?xml ... @2:7)  @ 

and it is showing in the console log that is trying to invoke the trunk//HPAXXXXNav/POM.XML file which is not the path provide in the Jenkins job.The path provided is trunk/HPAXXXXNav/ABC/POM.XML

I have another job where the structure is below and is working fine.The path in the job is trunk//HPAXXXXNav/POM.XML

trunk/HPAXXXXNav/
             |----ABC
             |----POM.XML

I am not sure whether this is a Jenkins and Git plugin issue and not able to call the correct pom.xml file if it is inside the multiple directory structure (A/B/C/pom.xml)as given in the above description because the same structure is working fine with Mercurial. Can someone let me know the issue?

 ERROR: Failed to parse POMs processing instruction can not have > PITarget with reserveld xml name (position: START_DOCUMENT seen \\r\\n<?xml ... @2:7) @ 

Seems as there is a line break in the first line ( \\r\\n ). Try to remove that. When trunk//HPAXXXXNav/POM.XML is the parent of trunk/HPAXXXXNav/ABC/POM.XML Maven needs to parse both that's why you get the error on that file.

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