So you can now run your scala app by defining the "mainClass" property :
mvn scala:run -DmainClass=org.example.MyClass
You need to use launchers if you :
<plugin> <groupId>maven</groupId> <artifactId>scala-maven-plugin</artifactId> <configuration> <launchers> <launcher> <id>foo</id> <mainClass>org.example.MyClass</mainClass> <!-- args are optional --> <args> <arg>arg1</arg> </args> <!-- jvmArgs are optional --> <jvmArgs> <jvmArg>-Xmx128m</jvmArg> <jvmArg>-Djava.library.path=...</jvmArg> </jvmArgs> </launcher> <!-- you could define other launcher --> </launchers> </configuration> </plugin>
Now you can run the following command to run your launcher (the classpath used is the test classpath).
mvn scala:run -Dlauncher=foo
If you don't specify launcher or mainClass then the first launcher is used, in your case, the example below is equivalent to the example above.
mvn scala:run
If you need/which to specify some additional arguments at call time use "-DaddArgs=arg1|arg2|arg3" ('|' is used as separator)
Set the property 'displayCmd' to true, to display the command line used