在maven项目中构建scala模块,这样的话可以java和scala互相调用,最好在环境变量中配置scala home,ide加载相关的模块进行编译运行。
pom中的配置如下:
org.scala-lang scala-library 2.10.4 org.scala-lang scala-actors 2.10.4 junit junit 4.8.1 test org.slf4j slf4j-api 1.5.11 provided com.google.guava guava 15.0 provided org.slf4j jcl-over-slf4j 1.5.11 test commons-logging commons-logging 99.0-does-not-exist test org.slf4j slf4j-log4j12 1.5.11 test log4j log4j 1.2.15 test javax.mail javax.jms jms org.apache.maven.plugins maven-compiler-plugin 2.3.2 org.apache.maven.plugins maven-resources-plugin 2.4.3 UTF-8 false ${*} net.alchim31.maven scala-maven-plugin 3.1.6 src/main/scala src/test/scala UTF-8 -encoding UTF-8 scala-compile-first process-resources add-source compile scala-test-compile process-test-resources testCompile scala-doc-generator package doc-jar