eclipse构建maven scala 项目 编译成功
eclipse构建maven scala 项目 编译成功
一、安装eclipse scala插件
系统:win7
eclipse版本:Luna Release(4.4.0)
maven是从EclipseMarket中安装的
2. 安装m2e-scala
3. 添加远程的原型或模板目录:
新建Archetype,因为maven默认没有Group Id: net.alchim31.maven Artifact Id: scala-archetype-simple Version:1.5
scala项目maven的编译打包
有可能会遇到:
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.0:compi
le (default) on project iteblog: wrap: org.apache.commons.exec.ExecuteException:
Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
原因是mvn clean package默认只处理java源代码的编译、打包,而不管scala,所以编译时遇到Hello这个由scala语言编写的class,此时scala还没编译生成class,所以找不到相应的调用入口。
解决办法:
mvn clean scala:compile compile package
如上,在compile前加入scala:compile,这是maven-scala-plugin插件提供的选项,表示编译scala,这样一来,先编译scala,再编译java,最后打包,妥妥滴!
一、安装eclipse scala插件
系统:win7
eclipse版本:Luna Release(4.4.0)
maven是从EclipseMarket中安装的
2. 安装m2e-scala
3. 添加远程的原型或模板目录:
新建Archetype,因为maven默认没有Group Id: net.alchim31.maven Artifact Id: scala-archetype-simple Version:1.5
scala项目maven的编译打包
有可能会遇到:
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.0:compi
le (default) on project iteblog: wrap: org.apache.commons.exec.ExecuteException:
Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
原因是mvn clean package默认只处理java源代码的编译、打包,而不管scala,所以编译时遇到Hello这个由scala语言编写的class,此时scala还没编译生成class,所以找不到相应的调用入口。
解决办法:
mvn clean scala:compile compile package
如上,在compile前加入scala:compile,这是maven-scala-plugin插件提供的选项,表示编译scala,这样一来,先编译scala,再编译java,最后打包,妥妥滴!