I want to execute the class file (or jar file) located in the same folder with pom.xml, which contains main method.
Here is my pom.xml
http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 tuomas sleep pom 1.0-SNAPSHOT
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version>
<executions>
<execution>
<id>sleep</id>
<phase>verify</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>tuomas.App</mainClass>
<classpathScope>tuomas</classpathScope>
</configuration>
</plugin>
</plugins>
</build>
And I get the following error:
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java (sleep) on project sleep: Execution sleep of goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java failed: Invalid classpath scope: tuomas -> [Help 1]
Here is my folder structure
pom.xml . ..tuomas..App.class
I have also tried not to specify classpathScope attribute in plugin configuration, and got the following error instead.
[WARNING]
java.lang.ClassNotFoundException: tuomas.App
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:281)
at java.lang.Thread.run(Thread.java:745)
Regardless of if the class file is under tuomas folder or in the project root. Also tried install the jar to local maven repository with no success.
How to configure this plugin to find the class from the project folder?