Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse 对pom.xml有问题_Eclipse_Maven_Selenium_Testng_Pom.xml - Fatal编程技术网

Eclipse 对pom.xml有问题

Eclipse 对pom.xml有问题,eclipse,maven,selenium,testng,pom.xml,Eclipse,Maven,Selenium,Testng,Pom.xml,我试图将Selenium TestNG集成到maven中,但在向pom.xml添加依赖项时遇到了问题(如本文所述),并且在相同的情况下出错。只有当我添加selenium和testng依赖项时,问题才会出现,因为我已经将这些库导入到项目中。下面是xml代码 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoca

我试图将Selenium TestNG集成到maven中,但在向pom.xml添加依赖项时遇到了问题(如本文所述),并且在相同的情况下出错。只有当我添加selenium和testng依赖项时,问题才会出现,因为我已经将这些库导入到项目中。下面是xml代码

<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>ProV1</groupId>
      <artifactId>ProV1</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.1</version>
                        <configuration>
                            <source>1.7</source>
                            <target>1.7</target>
                        </configuration>
                    </plugin>
                </plugins>
       </build>
       <dependencies>            
           <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.12</version>
          <scope>test</scope>
        </dependency>
            <dependency>              
                <groupId>org.seleniumhq.selenium</groupId>                              
                <artifactId>selenium-server</artifactId>                              
                <version>2.47.1</version>                               
            </dependency>             
            <dependency>              
                <groupId>org.testng</groupId>                               
                <artifactId>testng</artifactId>                             
                <version>6.9.5</version>                              
                <scope>test</scope>                                     
           </dependency>              
        </dependencies>
    </project>

4.0.0
箴言1
正如在一些文章中所建议的,我清理了项目,进行了刷新,但没有任何结果。

我是Maven的新手,因此对于如何解决此问题的所有有用建议,我将不胜感激。

通过删除依赖项解决了此问题,无需添加依赖项。Maven会自动添加它们。

我会尝试使用Maven强制更新,或者下载jar手册从您的项目中删除testNG和selenium的jar。Maven依赖项将负责在类路径中添加JAR。其次,转到
user\.m2存储库
。使用
*.lastUpdated
搜索。从结果中删除testNG和selenium jar&现在手动下载jar,将它们放在相同的.m2位置。现在运行
mvn测试
。它不应该给出工件传输错误。