Win-7 ホスト OS で実行されている Ubuntu VM のコマンド ラインから scala-maven-plugin を使用して、単純な Scala Hello World プログラムを実行しようとしています。
次の2つの方法で実行しようとしました:-
mvn scala:run -DmainClass=com.infoobjects.HelloWorld
pom.xml のランチャー タグでメイン クラスを宣言し
mvn scala:run
、コマンド ラインから実行する
しかし、どちらの場合も ClassNotFoundException を取得しています。
ディレクトリ構造:-
プロジェクト > src > main > scala > com > infoobjects > HelloWorld.scala
前もって感謝します。
ここに私のpom.xmlがあります
<build>
<finalName>sparkplay</finalName>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<configuration>
<launchers>
<launcher>
<id>launcher1</id>
<mainClass>com.infoobjects.HelloWorld</mainClass>
</launcher>
</launchers>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</configuration>
</plugin>
</plugins>
</build>