java 错误:Maven:不可解析的 POM ... 预期 START_TAG 或 END_TAG 不是 TEXT

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38593906/
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-11-03 03:33:32  来源:igfitidea点击:

Error: Maven: Non parseable POM ... expected START_TAG or END_TAG not TEXT

javamavennetbeanspom.xml

提问by Jaromando

I cannot figure this out for the life of me. Seems like not a hard issue at all.

我一生都无法弄清楚这一点。似乎根本不是什么难事。

POM:

聚甲醛:

enter image description here

在此处输入图片说明

Line underlined in red in the error line.

错误行中的红色下划线。

采纳答案by Z. Fenton

So I popped this into eclipse and it looks fine

所以我把它放到 eclipse 中,看起来不错

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>CENSORED</groupId>
    <artifactId>NeoImport</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.neo4j.driver</groupId>
            <artifactId>neo4j-java-driver</artifactId>
            <version>1.0.3</version>
        </dependency>
    </dependencies>
</project>

In your screen capture your syntax highlight for the <?xml?>is off at the end. Do you happen to have a newline character before that very first line?

在你的屏幕截图中,你的语法高亮显示<?xml?>在最后。你碰巧在第一行之前有一个换行符吗?

Or if you copied pasted it from somewhere else that formats the text differently than your IDE (i.e. UNIX/OSX vs Dos/Windows) then that may cause issues too.

或者,如果您从其他与您的 IDE 格式不同的地方复制粘贴它(即 UNIX/OSX 与 Dos/Windows),那么这也可能会导致问题。

回答by enayat tahvildari

If you can build your project in your local but you cannot build in Jenkins environment:

如果您可以在本地构建项目,但不能在 Jenkins 环境中构建:

  • Check if there are any problematic character at the specified line:
  • 检查指定行是否有问题字符:

Resolution: open your pom file in an editor like np++ to show special characters and removed those characters from your code.

解决方案:在 np++ 等编辑器中打开 pom 文件以显示特殊字符并从代码中删除这些字符。

  • If not, its Possibly be due to SCM conflicts.
  • 如果不是,则可能是由于 SCM 冲突。

Resolution: Go to Project Build configuration and change the "Check-Out Strategy" within Source Code Management. Use the strategy to first clean checkout instead of just update. Very Likely it should fix the problem that might have arose due to SCM conflicts.

解决方案:转到项目构建配置并更改源代码管理中的“签出策略”。使用该策略首先清理结帐,而不仅仅是更新。很可能它应该解决由于 SCM 冲突而可能出现的问题。

回答by Bakri Bitar

I had a similar problem where I get an error:

我有一个类似的问题,我得到一个错误:

unexpected character in markup < (position: END_TAG seen ...</developerConnection>

solved it by cutting the parent element of developerConnection and pasting it again!

通过剪切 developerConnection 的父元素并再次粘贴来解决它!