自学内容网 自学内容网

springCloud项目打包 ,maven package或install打包报错

在这里插入图片描述
解决思路一:

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.3.7.RELEASE</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.9.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

maven-compiler-plugin插件要指定版本号,和你的maven仓库一个版本的才行,不然打包还是会报错
在这里插入图片描述

在这里插入图片描述
这里我的3.9.0 大版本一样
而且 上面 configuration不指定对的话可能会报一下错:

  • “Maven编译报错:javacTask: 源发行版 1.8 需要目标发行版 1.8

另外也可了个有一下错误:

  • java: -source 1.7 中不支持 lambada 表达式
  • org/codehaus/plexus/archiver/jar/JarArchive

原文地址:https://blog.csdn.net/weixin_40796433/article/details/137696433

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!