0

我正在尝试将 scala-maven-plugin:3.1.0 与 Java 1.5 一起使用。但是,我的 Maven 构建因不兼容错误而失败。

 Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.1.0:compile (scala-compile-first) on project proj: Execution scala-compile-first of goal net.alchim31.maven:scala-maven-plugin:3.1.0:compile failed: Unable to load the mojo 'compile' in the plugin 'net.alchim31.maven:scala-maven-plugin:3.1.0' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Bad version number in .class file

还有一个不支持的类版本警告

WARNING: Error injecting: scala_maven.ScalaCompileMojo
java.lang.UnsupportedClassVersionError: Bad version number in .class file

该插件的文档说它需要 Java 1.5,所以我在那里看不到问题。我在本地使用 Java 1.5,也用于我的 Maven 构建。

关于问题出在哪里的任何建议?我看不到另一个版本的 Java 可以在哪里编译我的任何类,所以我猜测它在我拥有的一个依赖项中不兼容,但我没有找到它。我还导入了以下依赖项

<dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_2.9.0-1</artifactId>
            <version>2.0.M5</version>
        </dependency>
4

1 回答 1

1

@om-nom-nom 发布的答案 据我所知,scala 版本 scalatest 是针对(2.9.x)编译的,需要至少 1.6 版本的 Java 平台。

于 2013-03-20T15:05:26.043 回答