pom.xml配置
pom.xml文件中加入scala依赖及打包插件
org.scala-lang
scala-library
2.11.8
org.apache.maven.plugins
maven-compiler-plugin
3.6.1
1.7
1.7
net.alchim31.maven
scala-maven-plugin
3.2.2
org.apache.maven.plugins
maven-jar-plugin
3.0.2
true
lib/
spark.demo.run.Service
org.apache.maven.plugins
maven-dependency-plugin
3.0.0
package
copy-dependencies
${project.build.directory}/lib
mainClass为Java类,作为程序执行的入口。
maven构建命令
mvn clean scala:compile compile package -DskipTests=true
java运行命令
java -jar scala_java-0.0.1-SNAPSHOT.jar