I am trying to use maven to handle dependencies in a scala project in Eclipse. But once the project is converted to maven, the application wont run anymore.
Here is the steps to reproduce :
1) new scala project
- project name : test
- finish
2) new scala object
- name : hello_world
- finish
3) hello_world.scala
package test
object hello_world {
def main(args: Array[String]) {
println("Hello world !!!")
}
}
4) run scala application
- project : test
- main class : test.hello_world
result : working, hello world is printed
5) right clic on project -> configure -> convert to mavem project
- group id : test
- artifact id : test
- version : 0.0.1-SNAPSHOT
- packaging : jar
- finish
6) run scala application
- project : test
- main class : test.hello_world
result :
Error: Could not find or load main class test.hello_world
Versions details :
Eclipse 4.4.1 M2E 1.5.0 Scala IDE for Eclipse 4.0.0.nightly-2_11
Generated pom-xml :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>