0

我需要编译一个遗留的 scala 项目(Scala 版本 2.8.0)。版本与JDK8不兼容。因此,我想理想地使用 JDK 7 编译项目。我正在maven-compiler-plugin中寻找类似以下的配置。

<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>

scala-maven-plugin 中是否有类似的配置?

我也尝试过使用插件和 javacargs 文档中建议的“源”。但是这两个选项都不起作用。

    <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <version>3.4.2</version>
        <executions>
            <execution>
                <goals>
                    <goal>compile</goal>
                    <goal>testCompile</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <recompileMode>incremental</recompileMode>
            <source>1.7</source>
            <target>1.7</target>
            <javacArgs>
                <javacArg>-source</javacArg>
                <javacArg>1.7</javacArg>
                <javacArg>-target</javacArg>
                <javacArg>1.7</javacArg>
            </javacArgs>
        </configuration>
    </plugin>

有谁知道我做错了什么?我没有使用 JDK7 的选项

4

0 回答 0