当前位置: 首页 > 知识库问答 >
问题:

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

邢寒
2023-03-14

我正试着按照这些说明开始使用硒。我在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个答案

邵耀
2023-03-14

我见过这种情况,复制和粘贴最终将一个非打印字符放在文件的最开始,在最初的<之前。你没有看到--但Maven抱怨道。如果您使用的是Linux,请尝试“cat-v pom.xml”查看其中是否有这样的字符······

 类似资料:
  • 我检查了/m2/repository。但找不到任何相关的东西。

  • 无法将org.apache.maven:maven-archiver:pom:2.6从https://repo.maven.apache.org/maven2中缓存到本地存储库中,在central的更新间隔已过或强制更新之前,将不会重新尝试解决问题。原始错误:无法将工件org.apache.maven:maven-archiver:pom:2.6从/传送到central(https://repo.

  • 问题内容: 我刚刚通过npm在我的RHEL 6.0服务器上安装了Jenkins: 我还将端口配置为9917,以避免与Tomcat服务器冲突,从而允许我访问的Jenkins页面。在“ 解锁Jenkins” 页面上输入初始管理员密码后,出现空白页面,标题为“ SetupWizard [Jenkins]”。 谁知道我为什么会得到空白页,如何解决? 问题答案: 我发现在防火墙中打开端口9917后,空白页错

  • 问题内容: 我正在尝试使用sonatype链接通过菜单nad 为Eclipse(Galileo)安装Maven集成 http://m2eclipse.sonatype.org/sites/m2e 并得到以下错误: 由于找不到一个或多个必需项,因此无法完成安装。 正在安装的软件:Maven Integration for Eclipse(必需)0.12.0.20101115-1102(org.mav

  • 无法完成安装,因为找不到一个或多个必需的项目。正在安装的软件:M2E-Maven Integration for Eclipse 1.4.0.20130601-0317(org.Eclipse.m2e.feature.feature.group 1.4.0.20130601-0317)缺少要求:Maven Integration for Eclipse(Editors)1.4.0.20130601

  • 我在eclipse(Mars)中导入了一个项目,在我的pom.xml文件中有以下错误:“Missing artifact com.oracle:ojdbc7:jar:12.1.0.1” 这是代码: 我已经从Oracle下载了ojdbc7.jar,并尝试使用以下命令安装它: mvn安装:install-file-dgroupid=com.oracle-dartifactid=ojdbc7-dvers