Unable to Execute the Java file from command prompt using maven plugin | Selenium Forum
R
Rishabh Verma Posted on 25/05/2022

Hi Team,

I am unable to run script from command promt. I am refering maven video.

Getting Below error:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.510 s
[INFO] Finished at: 2022-05-25T15:00:42+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project MavenProjectFromCmd: An exception occured while executing the Java class. com.selenium.Sample -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Thanks

 

Maven Plugin seeting used in POM

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.selenium.Sample</mainClass>
<arguments>
<argument>foo</argument>
<argument>bar</argument>
</arguments>
</configuration>
</plugin>


R
Rishabh Verma Replied on 29/05/2022

This issue is resolved now.