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

Jar*_*ndo 6 java netbeans pom.xml maven

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

聚甲醛:

在此处输入图片说明

错误行中的红色下划线。

Z. *_*ton 4

所以我把它放入 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>
Run Code Online (Sandbox Code Playgroud)

在您的屏幕截图中,您的语法突出显示<?xml?>在末尾关闭。你碰巧在第一行之前有一个换行符吗?

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