安装Selenium POM时Maven中的空白错误

时间:2018-07-27 02:11:04

标签: java apache maven selenium

我正在尝试遵循these instructions来开始使用Selenium。我在Mac上下载并安装了Maven,但尝试将mvn clean install与建议的pom.xml文件一起使用时,出现以下错误:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM /Users/JB/Documents/Maven/Selenium-Build/pom.xml: only whitespace content allowed before start tag and not { (position: START_DOCUMENT seen {... @1:1)  @ line 1, column 1
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project  (/Users/JB/Documents/Maven/Selenium-Build/pom.xml) has 1 error
[ERROR]     Non-parseable POM /Users/JB/Documents/Maven/Selenium-Build/pom.xml: only whitespace content allowed before start tag and not { (position: START_DOCUMENT seen {... @1:1)  @ line 1, column 1 -> [Help 2] 

这是pom.xml文件

<?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>MySel20Proj</groupId>
    <artifactId>MySel20Proj</artifactId>
    <version>1.0</version>
    <dependencies>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
            <version>3.13.0</version>
        </dependency>
    </dependencies>

我在这里想念什么?我尝试过POM的结构看起来与研究此问题时发现的许多示例相同。我看不到文档开头抱怨的空白。我不熟悉Maven,确实需要一些帮助。

1 个答案:

答案 0 :(得分:0)

我已经看到这种情况发生在复制粘贴最终在文件的开始处,在该初始<之前放置一个非打印字符时。您看不到-但Maven抱怨。如果您使用的是Linux,请尝试“ cat -v pom.xml”以查看其中是否有此类字符...