のpom.xml見つけることができません。のscala-のmaven-pluginの混合コンパイルはSRC /メイン/ javaのを含んでいないと、Javaクラス
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
</execution>
</executions>
</plugin>
<plugin>
<!-- see http://davidb.github.com/scala-maven-plugin -->
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
<configuration>
<args>
<arg>-dependencyfile</arg>
<arg>${project.build.directory}/.scala_dependencies</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>
コード構造:
src/main/java
Hello.java
src/main/scala #will reference the class under /src/main/java
App.scala
IDE:IntelliJのをIDEA 2017年2月1日、JDK:java8
問題: 私はMavenのコンパイルを実行し、これまでintellijを介して、常にエラーの下に表示されます。つまり、Hello.classを見つけることができません。
質問:
これのpom.xmlが動作しない理由は?私はscal-maven-pluginの文書をチェックしましたが、レイアウトはうまくいくはずですが、そうではありませんでした。
build-helper-maven-pluginを使用してソースディレクトリとしてsrc/main/javaを追加するとうまくいくことがわかりました。これは最初の質問を説明するかもしれませんが、私はmavenコンパイルの前にIntellijを介してApp.scalaを実行していることに気づいたので、Hello.javaは既にクラスにコンパイルされていて、src/main/target /クラス 。なぜscala-maven-pluginはsrc/main/target/classesの下でクラスを見つけることができないのですか?
質問でリンクドキュメント/サンプルのよう
ありがとう参照 "追加"!それは私の懸念を解決した。 – Keith