解决IDEA maven多模块打包问题
参考:
https://www.jianshu.com/p/37c6688c4fcb
https://blog.csdn.net/sjhuangx/article/details/71519066
https://blog.csdn.net/qq_33547169/article/details/78866859

以此项目举例,zysuyuan-item-service依赖zysuyuan-item-entity和zysuyuan-common模块,开发和测试阶段不需要将entity和common模块进行打包发布到maven私服仓库,而当发布项目打包service时,需要将这两个模块entity和common发布到maven私服仓库,否则会造成service打包失败,会提示缺少entity和common的依赖
若发布(deploy)时报以下错误:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.9.RELEASE:repackage (default) on project SpringCloudUserFeign: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.5.9.RELEASE:repackage failed: Unable to find main class -> [Help 1]
解决方案:https://blog.csdn.net/qq_33547169/article/details/78866859
方案一、创建main方法
方案二、添加如下配置
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
使用maven可以方便的开发好的jar包发布到本地仓库中,方便其他项目依赖使用,在pom.xml文件中添加如下的配置:
<distributionManagement>
<repository>
<id>localRepository</id>
<url>file:F:\environment\wwk_repository</url>
</repository>
</distributionManagement>
即:(总)
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>localRepository</id>
<!-- 本地仓库地址-->
<url>file:F:\environment\wwk_repository</url>
</repository>
</distributionManagement>
解决IDEA maven多模块打包问题的更多相关文章
- Spirng boot maven多模块打包不踩坑
本文参考 https://blog.csdn.net/Ser_Bad/article/details/78433340 经过实战一次通过.回话不多说,话费不多说,直接上图. 项目整体结构: 父模块: ...
- spring boot maven多模块打包部署到tomcat
@SpringBootApplication(scanBasePackages = {"com.xxx.*"}) public class ApiApplication exten ...
- SpringBoot+Maven多模块项目(创建、依赖、打包可执行jar包部署测试)完整流程
一,创建Maven多模块项目先建立外层父工程 File →new →project 选择Spring Initializr Next下一步到以下页面 工程结构如下 ...
- 【spring cloud】【IDEA】【Maven】spring cloud多模块打包,打包的jar包只有几k,jar包无法运行,运行报错:no main manifest attribute, in /ms-eureka.jar
======================================================================================== 引申:maven打包多 ...
- Maven多模块项目打包前的一些注意事项(打包失败)
一. 最近在打包Maven项目时遇到了点问题,这个项目是Maven多模块项目,结构如下: projectParent├── xxxx-basic├── xxxx-web1├── xxxx-collec ...
- Maven之多模块打包成一个jar包及assembly
一.多模块打包 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="htt ...
- SpringBoot+Maven 多模块项目的构建、运行、打包
SpringBoot+Maven 多模块项目的构建.运行.打包 https://blog.csdn.net/zekeTao/article/details/79413919
- Maven多模块工程打包指定模块工程方法
Maven多模块工程打包指定模块工程执行如下命令: mvn clean package -pl 指定模块工程名 -am 参数说明: -am --also-make 同时构建所列模块的依赖模块:-am ...
- SpringBoot+Maven 多模块项目的构建、运行、打包实战
前言 最近在做一个很复杂的会员综合线下线上商城大型项目,单模块项目无法满足多人开发和架构,很多模块都是重复的就想到了把模块提出来,做成公共模块,基于maven的多模块项目,也好分工开发,也便于后期微服 ...
随机推荐
- vue+ElementUI——表格分页(前端实现方法)
1.使用ElementUI中的<el-table></el-table>和 <el-pagination></el-pagination>组件来实现 2 ...
- Java语言支持的变量类型有
Java语言支持的变量类型有: 类变量:独立于方法之外的变量,用 static 修饰. 实例变量:独立于方法之外的变量,不过没有 static 修饰. 局部变量:类的方法中的变量.
- Win10下使用默认的照片查看器
在打开图片的时候默认是 画图,我们想要用windows图片器打开,但是更多应用里面没有这一选项, 按 Windows徽标键+R键,打开运行命令窗口,输入"regedit"命令 来打 ...
- css---5 only-child or nth-of-type
1 _nth-child系列 :nth-child(index) <!DOCTYPE html> <html lang="en"> <head> ...
- Qt Creator配置
1.安装Git sudo apt install git 2.配置Git 用户和邮箱: git config --global user.name "xxx" git config ...
- 一个切图仔的 JS 笔记
1,常用数据操作 Math.round(mum,2);num.toFixed(2);两位数 Math.floor(); 返回不大于的最大整数 Math.ceil(); 则是不小于他的最小整数 Math ...
- 用原生js封装轮播图
原生js封装轮播图 对于初学js的同学来说,轮播图还是一个难点,尤其是原生js封装轮播图代码,下面是我之前做的一个轮播图项目中封装好的一些代码,有需要的同学可以看一下,有什么不懂的可以看注释,注释看不 ...
- 关于type return to continue,or q <return> to quit
由于GDB要打印的信息被分页了 所以需要设置不分页显示 set pagination off
- python基础语法(变量与数据类型)
python基础语法(变量与数据类型) 一.python变量 python中的变量不需要声明.每个变量在使用钱都需要赋值,变量赋值以后,该变量才会被创建 在python中,变量就是变量,它没有类型,我 ...
- java 测试时 程序的 运行时间
检测一个JAVA程序的运行时间方法:long startTime = System.currentTimeMillis();//获取当前时间//doSomeThing(); //要运行的java程 ...