Required Configuration for running maven project from command line.
Asked
Active
Viewed 278 times
3
-
Did you check - http://stackoverflow.com/questions/10391312/testng-surefire-run-suite-with-maven-command-line – Helping Hands Feb 05 '15 at 10:28
-
@Helping Hands - I had tried it but it didn't work for me. – Feb 05 '15 at 11:08
-
ok..does that answer helped you here which is posted by Sagar007 – Helping Hands Feb 05 '15 at 11:08
-
@ Helping Hands - Yes it was helpful. – Feb 05 '15 at 11:10
1 Answers
1
Very Nice question. I had also stuck with same question but I have found solution. Required two maven plug-ins which are given under. Please make sure your JDK 1.7 and JRE 7 version is configure in your project. Add this plugin to your pom.xml and follow this step:
1 mvn clean
2 mvn install
3 mvn exec:java
Step 3 is required to run project without specify main class
<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>

Sagar007
- 848
- 1
- 13
- 33
-
You should share how you got solution so questioner can solve his/her issue also. – Helping Hands Feb 05 '15 at 10:27
-
-