私は現在、JavaとScala(Spark)を混在させたプロジェクトを扱っています。そして、これが十分ではなかったかのように、私の依存関係のいくつかはここでは、要約するとスパークとスカラ座(レトロな互換性はありません)の別のバージョン...maven-compiler-pluginとscala-maven-pluginの違いは何ですか?
をインポートし、私の依存関係ツリーがどのように見えるかです:
myProjectA
\_ myLibB
| \_ spark 1.5.2 (excluded in my pom.xml)
| \_ scala 2.10.4 (excluded in my pom.xml)
\_ spark 2.2.0 (with Scala 2.11)
| \_ scala 2.11.7
\_ scala 2.11.11
\_ java 8
私のプロジェクト内のマップ上で小さな変更を行った後は、コンパイルがもう機能しません。参考までに、修正はハードコーディングされたマップに要素を追加することで構成されていました。
したがって、私は私のプロジェクトをコンパイルするための解決策を探しています。私は現在、このビルド構成を使用しています:
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.1.3</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>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
私は、この他の設定も以前の設定のバグを作っ変更後だけで正常に動作するようことに気づいた(私はmaven-compiler-plugin
でscala-maven-plugin
を置き換え):
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
2つの質問
maven-compiler-plugin
とscala-maven-plugin
の違いは何ですか?
- can maven-compiler-plugin
効率的にコンパイルするScala code/mixed Java-Scala code?