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

问题描述 投票:0回答:1

我想跟随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不熟悉,我真的需要一些帮助。

java apache maven selenium
1个回答
0
投票

我发现当复制粘贴最终在文件的最开头放置一个非打印字符时,就会发生这种情况。你没有看到它 - 但是Maven抱怨道。如果您在Linux中,请尝试“cat -v pom.xml”以查看其中是否有任何此类字符...

© www.soinside.com 2019 - 2024. All rights reserved.