繁体   English   中英

对于工件{org.scala-sbt:compiler-bridge_2.11:null:jar},scala-maven-plugin编译失败

[英]scala-maven-plugin compile failed For artifact {org.scala-sbt:compiler-bridge_2.11:null:jar}

似乎scala maven存储库中的某些内容发生了更改,导致我收到了之前工作过的项目的新错误。 如果我在自己的计算机上运行,​​它将运行,因为我的.m2文件夹缺少jar文件,但是在新计算机上运行(圆圈ci)时,它将失败。

日志:

ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:4.0.0:compile (scala-compile) on project my-project-name: Execution scala-compile of goal net.alchim31.maven:scala-maven-plugin:4.0.0:compile failed: For artifact {org.scala-sbt:compiler-bridge_2.11:null:jar}: The version cannot be empty. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

pom如下所示:

        <!-- scala plugins -->
        <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <!--<recompileMode>incremental</recompileMode>-->
            <executions>
                <execution>
                    <id>scala-compile</id>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>add-source</goal>
                        <goal>compile</goal>
                    </goals>
                </execution>
                <execution>
                    <id>scala-test-compile</id>
                    <phase>process-test-resources</phase>
                    <goals>
                        <goal>testCompile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

我认为这是一个新问题-如果有人有解决方法,我将不胜感激

通过将版本添加到Maven插件解决了问题:

    <!-- scala plugins -->
    <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <version>3.0.2</version>
        <!--<recompileMode>incremental</recompileMode>-->
        <executions>
            <execution>
                <id>scala-compile</id>
                <phase>process-resources</phase>
                <goals>
                    <goal>add-source</goal>
                    <goal>compile</goal>
                </goals>
            </execution>
            <execution>
                <id>scala-test-compile</id>
                <phase>process-test-resources</phase>
                <goals>
                    <goal>testCompile</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
<plugin> 
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.0</version>
<execution>
......
.......
</executions>
</plugin>

“添加版本标签”

我遇到了同样的问题,谢谢Ehud Lev分享了他的解决方案。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM