参考:

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. [JZOJ6258] 【省选模拟8.9】轰炸

    题目 题目大意 给你一棵树和树上的许多条从后代到祖先的链,选择每条链需要一定代价,问覆盖整棵树的所有点的最小代价是多少. \(n,m\leq 100000\) 正解 (由于时间过于久远,所以直接说正解 ...

  2. bzoj1433: [ZJOI2009]假期的宿舍 [二分图][二分图最大匹配]

    Description Input Output Sample Input 1 3 1 1 0 0 1 0 0 1 1 1 0 0 1 0 0 Sample Output ˆ ˆ HINT 对于30% ...

  3. java编程规约二

    四.OOP规约(Object Oriented Programming,面向对象设计) 1.静态变量和静态方法直接用类名访问,不要再new 对象去访问 2.方法覆盖必须加@Override注解 3.尽 ...

  4. <Python基础>字符串的基本操作

    s = 'abCDeFg aBcDea' print(s.find('b')) #通过元素查找索引,找不到返回-1 print(s.index('b')) #通过元素查找索引,找不到报错(会报错,基本 ...

  5. python语句结构(range函数)

    python语句结构(range函数) range()函数 如果你需要遍历数字序列,可以使用内置range()函数,它会生成序列 也可以通过range()函数指定序列的区间 也可以使用range()函 ...

  6. js 获取自定义属性值

    html: <p tid="1" onClick="change()">111</p> <p tid="2" ...

  7. java_增强for循环

    增强for循环(foreach): 底层使用了迭代器,简化了迭代器的书写 JDK1.5新特性 所有的单列集合都可以使用增强for循环 for(集合/数组 的数据类型 变量名 : 集合名/数组名) pu ...

  8. Ubuntu环境下使用Maven编译并打包Java项目

    一.安装Maven 打开终端输入以下指令: $ mvn -v Apache Maven Maven home: /usr/share/maven Java version: 1.8.0_181, ve ...

  9. 2018-8-10-如何删除错误提交的-git-大文件

    title author date CreateTime categories 如何删除错误提交的 git 大文件 lindexi 2018-08-10 19:16:51 +0800 2018-2-1 ...

  10. [sonata admin] argument "$code" of method

    2. CREATING AN ADMIN 按照这里,在 AppBundle中的Controller创建了 CategoryAdmin 类,当运行 php bin/console server:star ...