参考:

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多模块打包问题的更多相关文章

  1. Spirng boot maven多模块打包不踩坑

    本文参考 https://blog.csdn.net/Ser_Bad/article/details/78433340 经过实战一次通过.回话不多说,话费不多说,直接上图. 项目整体结构: 父模块: ...

  2. spring boot maven多模块打包部署到tomcat

    @SpringBootApplication(scanBasePackages = {"com.xxx.*"}) public class ApiApplication exten ...

  3. SpringBoot+Maven多模块项目(创建、依赖、打包可执行jar包部署测试)完整流程

    一,创建Maven多模块项目先建立外层父工程         File →new →project  选择Spring Initializr          Next下一步到以下页面 工程结构如下 ...

  4. 【spring cloud】【IDEA】【Maven】spring cloud多模块打包,打包的jar包只有几k,jar包无法运行,运行报错:no main manifest attribute, in /ms-eureka.jar

    ======================================================================================== 引申:maven打包多 ...

  5. Maven多模块项目打包前的一些注意事项(打包失败)

    一. 最近在打包Maven项目时遇到了点问题,这个项目是Maven多模块项目,结构如下: projectParent├── xxxx-basic├── xxxx-web1├── xxxx-collec ...

  6. Maven之多模块打包成一个jar包及assembly

    一.多模块打包 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="htt ...

  7. SpringBoot+Maven 多模块项目的构建、运行、打包

    SpringBoot+Maven 多模块项目的构建.运行.打包 https://blog.csdn.net/zekeTao/article/details/79413919

  8. Maven多模块工程打包指定模块工程方法

    Maven多模块工程打包指定模块工程执行如下命令: mvn clean package -pl  指定模块工程名 -am 参数说明: -am --also-make 同时构建所列模块的依赖模块:-am ...

  9. SpringBoot+Maven 多模块项目的构建、运行、打包实战

    前言 最近在做一个很复杂的会员综合线下线上商城大型项目,单模块项目无法满足多人开发和架构,很多模块都是重复的就想到了把模块提出来,做成公共模块,基于maven的多模块项目,也好分工开发,也便于后期微服 ...

随机推荐

  1. STL之__ type_traits

    __type_traits:双底线是说明这是SGI STL内部使用的东西,不在STL标准范围之内.iterator_traits负责萃取迭代器(iterator)的特性.而__type_traits则 ...

  2. MYSQL - database 以及 table 的增删改查

    MYSQL - database 以及 table 的增删改查 MySQL的相关概念介绍 MySQL 为关系型数据库(Relational Database Management System), 这 ...

  3. 组合数学——cf991E

    /* 如果有某一位,那么这一位必须存在 枚举所有情况,计算每种情况时0额外另算 */ #include<bits/stdc++.h> using namespace std; #defin ...

  4. csp-s模拟测试87

    csp-s模拟测试87 考场状态还可以$T1$我当时以为我秒切,$T2$确认自己思路不对后毅然决然码上,$T3$暴力挂了太可惜了. 03:01:28 03:16:07 03:11:38 140 03: ...

  5. Oracle Spatial导入shp数据

    现在开始尝试用oracle spatial管理空间数据,刚学会shp数据的导入,总结如下.oracle11g安装后,已经有了oracle spatial组件,我们只需要用shp2sdo.exe工具,就 ...

  6. Pascal 排序算法

    Pascal 排序   排序 排序就是将杂乱无章的数据元素,通过一定的方法按关键字顺序排列的过程.排序问题是一个十分重要的问题,并且排序的方法有很多种: 例子:输入20个数,将它们按照从高到低的次序排 ...

  7. PAT甲级——A1112 Stucked Keyboard【20】

    On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the char ...

  8. 继承关系中子类使用@Data注解问题

    HashSet中使用@Data注解问题 平时习惯使用lombok工具,免去了我们写get.set方法之类的,当然了,我们使用@Data注解后,equals().hashCode().toString( ...

  9. pom.xml文件配置maven仓库地址

    中央仓库就是Maven的一个默认的远程仓库,Maven的安装文件中自带了中央仓库的配置($M2_HOME/lib/maven-model-builder.jar) 在很多情况下,默认的中央仓库无法满足 ...

  10. OpenGL键盘交互响应事件

    GLUT允许我们编写程序,在里面加入键盘输入控制,包括了普通键,和其他特殊键(如F1,UP).在这一章里我们将学习如何去检测哪个键被按下,可以从GLUT里得到些什么信息,和如何处理键盘输入.   处理 ...