用php做的录入成绩的网站,用什么浏览器开wordpress最好,深圳建设局网站首页,微信营销模式有哪些SpringCloud项目打包注意事项和可能出错的几种情况 1、检查子模块中的 parent的pom文件路径 \relativePath/\2、检查打包插件的位置3、检查module是否重复引用 欢迎访问我的个人博客#xff1a;https://wk-blog.vip
1、检查子模块中的 parent的pom文件路径 relat… SpringCloud项目打包注意事项和可能出错的几种情况 1、检查子模块中的 parent的pom文件路径 \relativePath/\2、检查打包插件的位置3、检查module是否重复引用 欢迎访问我的个人博客https://wk-blog.vip
1、检查子模块中的 parent的pom文件路径 relativePath/
1.1、默认值
默认我们可以不用写 此时默认就是 ../pom.xml会从当前目录的上一级目录中获取parent 的 pom
parentgroupId***/groupIdartifactId***/artifactIdversion***/version
/parent1.2、relativePath/
设定一个空值将始终从仓库中获取不从本地路径获取relativePath 本地仓库 远程仓库
parentgroupId***/groupIdartifactId***/artifactIdversion***/versionrelativePath/
/parent1.3、relativePath某个pom的路径relativePath/
手动指定 parent的pom 位置
parentgroupId***/groupIdartifactId***/artifactIdversion***/versionrelativePath../pom.xml/relativePath
/parent2、检查打包插件的位置
打包插件的引入方式如下
buildpluginsplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactId/plugin/plugins/build一般情况下在开发SpringCloud项目时都会抽离出一些公共模块用来存放常用的工具类配置类。这些模块是不需要启动运行的而是单纯的作为一个依赖供其他模块使用所以我们在打包的时候这些作为依赖的模块是不需要引入打包插件的并且也不需要提供 SpringBoot 启动类。
如果引入了打包插件则可能会出现以下错误
没有SpringBoot启动类情况
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.12.RELEASE:repackage (repackage) on project xxxxxxExecution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.3.12.RELEASE:repackage failed: Unable to find main class
存在SpringBoot启动类的情况 Error:(4,29) java: 程序包xxxxxx不存在 对于需要通过SpringBoot启动的模块则需要引入打包插件一般我们都会将打包插件放在父模块中例如 A 模块是整个项目的父模块而 B 模块是 A 模块下的一个依赖模块C 模块是 A 模块下的运行模块的父模块D 是 C 模块下的运行模块那么此时就可以将 打包插件引入到 C 模块中这样 C 模块下的所有运行模块都可以被maven成功打包为可运行的 jar 包。
3、检查module是否重复引用
如果出现module的重复引用则打包的时候会出现以下错误
Project xxxxxx is duplicated in the reactor
重复引用的有以下几种方式
假设 A模块 的 pom 中聚合了 B 和 C 两个子模块此时如果子模块 B 引入了 C模块 作为自己的子模块就会导致重复引入冲突。
或者 A模块 中聚合了 B模块同时 A 的父模块 (假设是parent) 中也引入了 B模块 也会导致出现重复引入冲突。
重复引用1C模块既让A模块引用又让B模块引用A模块是B和C的父模块 artifactIdA/artifactIdpackagingpom/packagingmodulesmoduleB/modulemoduleC/module/modulesartifactIdB/artifactIdpackagingpom/packagingmodulesmoduleC/module/modules重复引用2A 的父模块中引入了 B模块或者C模块A模块是B和C的父模块parent是A的父模块 artifactIdParent/artifactIdpackagingpom/packagingmodulesmoduleA/modulemoduleA/B/modulemoduleA/C/module/modules