0
我有一个混合的Scala/Java项目的问题,并得到一切编译。我正在使用像许多网站(如http://davidb.github.io/scala-maven-plugin/example_java.html)中的scala-maven-plugin和maven-compiler-plugin。混合Scala/Java无法编译,错误:无法访问
所得错误消息是(SResize是一个阶类)
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project tipl-spark: Compilation failure
[ERROR] error: cannot access SResize$sstats$4$
[ERROR] -> [Help 1]
[ERROR]
在生成部
为阶-行家-插件
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>attach-scaladocs</id>
<phase>verify</phase>
<goals>
<goal>doc-jar</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>UTF-8</encoding>
<args>
<arg>-unchecked</arg>
<arg>-deprecation</arg>
<arg>-feature</arg>
<arg>-language:postfixOps</arg>
</args>
<jvmArgs>
<jvmArg>${java.memory.min}</jvmArg>
<jvmArg>${java.memory.max}</jvmArg>
<jvmArg>-XX:PermSize=${PermGen}</jvmArg>
<jvmArg>-XX:MaxPermSize=${MaxPermGen}</jvmArg>
</jvmArgs>
</configuration>
</plugin>
的行家编译
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
如果scala项目不依赖于java,那么尝试分别构建它们并将构建好的scala.jar导入到java项目中 – AntJavaDev 2014-10-03 11:21:22