Maven 发布插件:不允许匹配“[xX][mM][lL]”的处理指令目标
Posted
技术标签:
【中文标题】Maven 发布插件:不允许匹配“[xX][mM][lL]”的处理指令目标【英文标题】:Maven Release Plugin: The processing instruction target matching "[xX][mM][lL]" is not allowed 【发布时间】:2020-01-26 03:41:22 【问题描述】:最近,在执行 Maven 发布插件的 release:prepare 目标时,我们的 Ci 工作让我眼前一亮。我收到一个奇怪的 SAX 解析错误:Caused by: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 6; The processing instruction target matching "[xX][mM][lL]" is not allowed.
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPIData(XMLScanner.java:746)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanPIData(XMLDocumentFragmentScannerImpl.java:1014)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPI(XMLScanner.java:714)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:907)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
build 25-Sep-2019 13:42:25 at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
build 25-Sep-2019 13:42:25 at org.jdom.input.SAXBuilder.build(SAXBuilder.java:453)
虽然我可以mvn clean install
这个项目就好了...
【问题讨论】:
【参考方案1】:好的,原来其中一个子模块在 pom.xml 的开头有一个换行符。 Maven 本身显然并不关心这个,但是 Maven 发布插件无法解析这个并炸毁了我。
【讨论】:
以上是关于Maven 发布插件:不允许匹配“[xX][mM][lL]”的处理指令目标的主要内容,如果未能解决你的问题,请参考以下文章
错误:不允许匹配“[xX][mM][lL]”的处理指令目标[重复]
“[致命错误]:1:120:不允许匹配“[xX][mM][lL]”的处理指令目标。” [复制]