繁体   English   中英

构建Selenium + Maven时出错:缺少pom.xml

[英]Error building Selenium+Maven: missing pom.xml

我是Selenium和Maven工具的新手。 通过本指南尝试使用Maven设置Selenium 2.0 Java项目。

在项目目录中创建并保存pom.xml之后,我运行mvn clean install并得到以下错误:

(...) The goal you specified requires a project to execute but there is no POM in this directory (C:\\Users\\User\\Documents\\TestAutomation). Please verify you invoked Maven from the correct directory. -> [Help 1]

我的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-java</artifactId> <version>2.45.0</version> </dependency> </dependencies> </project>

我在Windows 7上安装了Maven 3.3.1和Java 1.8.0。

任何想法,我在做什么错? 一般而言,我对测试工具的经验很少。

好的,问题出在文件扩展名。 它实际上保存为pom.xml.txt ,而不是我期望的pom.xml (通过dir命令发现)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM