Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.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中的Maven项目中找不到bin文件夹_Maven_Testng_Classpath_Bin_Lib - Fatal编程技术网

在Eclipse中的Maven项目中找不到bin文件夹

在Eclipse中的Maven项目中找不到bin文件夹,maven,testng,classpath,bin,lib,Maven,Testng,Classpath,Bin,Lib,要从命令提示符下运行testng test,我必须设置类路径并运行测试 C:\newworkspace\SeleniumSample>set classpath=C:\newworkspace\SeleniumSample\bin;C:\newworkspace\SeleniumSample\lib* C:\newworkspace\SeleniumSample>java org.testng.testng.xml 我的maven项目不包含bin或lib文件夹。我手动创建了lib文件夹,并将JA

要从命令提示符下运行testng test,我必须设置类路径并运行测试 C:\newworkspace\SeleniumSample>set classpath=C:\newworkspace\SeleniumSample\bin;C:\newworkspace\SeleniumSample\lib*

C:\newworkspace\SeleniumSample>java org.testng.testng.xml


我的maven项目不包含bin或lib文件夹。我手动创建了lib文件夹,并将JAR添加到此文件夹中。任何帮助都很好。

maven没有bin文件夹,因为POM文件中提到的所有依赖JAR文件都已下载并保存在${user.home}/.m2文件夹中。如果您想从命令行触发TestNG测试用例,可以通过在POM中配置插件来使用Maven Surefire插件进行TestNG

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
                <failIfNoTests>true</failIfNoTests>
                <skipTests>false</skipTests>
                <suiteXmlFiles>
                    <suiteXmlFile>${testNGXMLFile}</suiteXmlFile>
                </suiteXmlFiles>
                <properties>
                    <property>
                        <name>usedefaultlisteners</name>
                        <value>true</value>
                    </property>
                </properties>
                <workingDirectory>${basedir}</workingDirectory>
            </configuration>
        </plugin>
    </plugins>
</build>
更多有关

mvn clean test -DtestNGXMLFile=src\test\resources\testng.xml