[英]What configuration required to run maven project with selenium (TestNG) from command line?
从命令行运行maven项目所需的配置。
Very Nice question. 非常好的问题。 I had also stuck with same question but I have found solution.
我也遇到了同样的问题,但我找到了解决办法。 Required two maven plug-ins which are given under.
需要两个maven插件。 Please make sure your JDK 1.7 and JRE 7 version is configure in your project.
请确保在项目中配置了JDK 1.7和JRE 7版本。 Add this plugin to your pom.xml and follow this step:
将此插件添加到您的pom.xml并按照以下步骤操作:
1 mvn clean 1 mvn清洁
2 mvn install 2 mvn安装
3 mvn exec:java 3 mvn exec:java
Step 3 is required to run project without specify main class 步骤3是运行项目而不指定主类所必需的
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>${project.build.sourceEncoding}</encoding>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<executable>${env.JAVA_HOME}/bin/javac</executable>
<fork>true</fork>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>com.mainClass</mainClass>
</configuration>
</plugin>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.