1,重复的model

  1. [INFO] Scanning for projects...
  2. [ERROR] [ERROR] Some problems were encountered while processing the POMs:
  3. [ERROR] 'modules.module[6]' specifies duplicate child module authService @ line , column
  4. @
  5. [ERROR] The build could not read project -> [Help ]
  6. [ERROR]
  7. [ERROR] The project cn.meylink:root:1.0-SNAPSHOT (E:\Documents\Projects\cn.meylink\pom.xml) has error
  8. [ERROR] 'modules.module[6]' specifies duplicate child module authService @ line , column
  9. [ERROR]
  10. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  11. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  12. [ERROR]
  13. [ERROR] For more information about the errors and possible solutions, please read the following articles:
  14. [ERROR] [Help ] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

在主pom.xml文件的models节点 移除 指定位置 重复的 model 我这里提示的 pom.xml 15行 authService重复

2,maven-plugin-plugin版本过低,升级

  1. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor (default-descriptor) on project pojo: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor failed: -> [Help ]
  2. [ERROR]
  3. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  4. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  5. [ERROR]
  6. [ERROR] For more information about the errors and possible solutions, please read the following articles:
  7. [ERROR] [Help ] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
  8. [ERROR]
  9. [ERROR] After correcting the problems, you can resume the build with the command
  10. [ERROR] mvn <goals> -rf :pojo

找到pom文件(可是是根pom也可是当前model的pom,我这里提到的事pojo这个model,为了一劳永逸我在root pom上统一处理),build->plugins->plugin加入红色部分

  1. <plugin>
  2. <groupId>org.apache.maven.plugins</groupId>
  3. <artifactId>maven-plugin-plugin</artifactId>
  4. <version>3.5</version>
  5. </plugin>

3,No mojo definitions were found for plugin

  1. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.5:descriptor (default-descriptor) on project pojo: Error extracting plugin descriptor: 'No mojo definitions were found for plugin: cn.meylink.mall:pojo.' -> [Help ]
  2. [ERROR]
  3. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  4. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  5. [ERROR]
  6. [ERROR] For more information about the errors and possible solutions, please read the following articles:
  7. [ERROR] [Help ] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  8. [ERROR]
  9. [ERROR] After correcting the problems, you can resume the build with the command
  10. [ERROR] mvn <goals> -rf :pojo

这个问题百度很久解决不了,只能先跳过,找到pom文件加入红色部分,build->plugins->plugin加入红色部分

  1. <plugin>
  2. <groupId>org.apache.maven.plugins</groupId>
  3. <artifactId>maven-plugin-plugin</artifactId>
  4. <version>3.5</version>
  5. <configuration>
  6.   <!-- see http://jira.codehaus.org/browse/MNG-5346 -->
  7.   <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
  8.   </configuration>
  9. </plugin>

5,model编译类型错误

  1. [ERROR] Failed to execute goal on project commonWeb: Could not resolve dependencies for project commonWeb:maven-plugin:1.0-SNAPSHOT: Could not find artifact commonBase:jar:1.0-SNAPSHOT -> [Help ]
  2. [ERROR]
  3. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  4. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  5. [ERROR]
  6. [ERROR] For more information about the errors and possible solutions, please read the following articles:
  7. [ERROR] [Help ] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
  8. [ERROR]
  9. [ERROR] After correcting the problems, you can resume the build with the command
  10. [ERROR] mvn <goals> -rf :commonWeb

继续往上查看输入日志:

  1. [INFO] Building commonBase 1.0-SNAPSHOT
  2. [INFO] ------------------------------------------------------------------------
  3. [INFO]
  4. [INFO] --- maven-install-plugin:2.5.:install (default-install) @ commonBase ---
  5. [INFO] Installing E:\Documents\Projects\cn.meylink\commonBase\pom.xml to C:\Users\Administrator\.m2\repository\cn\meylink\commonBase\1.0-SNAPSHOT\commonBase-1.0-SNAPSHOT.pom
  6. [INFO]
  1. 被编译为:commonBase-1.0-SNAPSHOT.pom,而引用中需要 commonBase-1.0-SNAPSHOT.jar,修改被引用model生成类型为 jar 即:
  1. <packaging>maven-plugin</packaging>

6,注释错误

  1. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.5:descriptor (default-descriptor) on project repository: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.5:descriptor failed: syntax error @[,] in file:/E:/Documents/Projects/cn.meylink/mall/repository/src/main/java/cn/meylink/mall/repository/CategoryInfoRepository.java -> [Help ]
  2. [ERROR]
  3. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  4. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  5. [ERROR]
  6. [ERROR] For more information about the errors and possible solutions, please read the following articles:
  7. [ERROR] [Help ] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
  8. [ERROR]
  9. [ERROR] After correcting the problems, you can resume the build with the command
  10. [ERROR] mvn <goals> -rf :repository

很奇怪,去看看  [11,126] in file:/E:/Documents/Projects/cn.meylink/mall/repository/src/main/java/cn/meylink/mall/repository/CategoryInfoRepository.java  文件内容如下:

7,全部 install 完成

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] root .................................... SUCCESS [ 0.296 s]
[INFO] mall .................................... SUCCESS [ 0.021 s]
[INFO] mall.pojo ............................... SUCCESS [ 5.967 s]
[INFO] mall.mapper ............................. SUCCESS [ 2.480 s]
[INFO] commonBase .............................. SUCCESS [ 0.023 s]
[INFO] commonWeb Maven Mojo ............................... SUCCESS [ 2.453 s]
[INFO] mall.service ............................ SUCCESS [ 3.515 s]
[INFO] mall .................................... SUCCESS [ 19.318 s]
[INFO] mall.model .............................. SUCCESS [ 1.727 s]
[INFO] mall.webManage .......................... SUCCESS [ 9.473 s]
[INFO] mall.webAdmin ........................... SUCCESS [ 9.042 s]
[INFO] authService ............................. SUCCESS [ 2.897 s]
[INFO] webSocket ............................... SUCCESS [ 11.171 s]
[INFO] yuec2c .................................. SUCCESS [ 0.020 s]
[INFO] pojo Maven Mojo .................................... SUCCESS [ 2.042 s]
[INFO] yuec2c.repository ....................... SUCCESS [ 1.971 s]
[INFO] yuec2c.service .......................... SUCCESS [ 2.743 s]
[INFO] yuec2c.webApi ........................... SUCCESS [ 17.222 s]
[INFO] fileService ........................................ SUCCESS [ 12.551 s]
[INFO] worker ............................................. SUCCESS [ 3.406 s]
[INFO] commonQueue Maven Mojo ............................. SUCCESS [ 1.094 s]
[INFO] payment ............................................ SUCCESS [ 11.515 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:02 min
[INFO] Finished at: 2019-02-18T19:17:36+08:00
[INFO] Final Memory: 132M/1514M
[INFO] ------------------------------------------------------------------------

Process finished with exit code 0

8,docker build :pom.xml添加一个build->plugins->plugin内容如下:

  1. <!-- Docker maven plugin -->
  2. <plugin>
  3. <!-- https://mvnrepository.com/artifact/com.spotify/docker-maven-plugin -->
  4. <groupId>com.spotify</groupId>
  5. <artifactId>docker-maven-plugin</artifactId>
  6. <version>1.2.0</version>
  7. <configuration>
  8. <imageName>${docker.image.prefix}/${project.name}</imageName>
  9. <dockerDirectory>src/main/docker</dockerDirectory>
  10. <resources>
  11. <resource>
  12. <targetPath>/</targetPath>
  13. <directory>${project.build.directory}</directory>
  14. <include>${project.build.finalName}.war</include>
  15. </resource>
  16. </resources>
  17. </configuration>
  18. </plugin>
  19. <!-- Docker maven plugin -->

执行 maven 命令

  1. package docker:build

(1)Dockerfile文件不存在或路径错误

  1. [INFO] --- docker-maven-plugin:1.2.:build (default-cli) @ authService ---
  2. [INFO] Using authentication suppliers: [ConfigFileRegistryAuthSupplier]
  3. [INFO] No Dockerfile in dockerDirectory
  4. [INFO] Skipping docker build
  5. [INFO] ------------------------------------------------------------------------
  6. [INFO] BUILD SUCCESS
  7. [INFO] ------------------------------------------------------------------------
  8. [INFO] Total time: 8.569 s
  9. [INFO] Finished at: --19T09::+:
  10. [INFO] Final Memory: 55M/556M
  11. [INFO] ------------------------------------------------------------------------
  12.  
  13. Process finished with exit code

上面没有启动docker编辑 显示没找到Dockerfile文件,检查你的Dockerfile文件路径与文件名是否正确

(2)image名称不能包含大写字母

  1. [INFO] Building image ejiyuan/authService
  2. 二月 , :: 上午 com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RetryExec execute
  3. 信息: I/O exception (java.net.SocketException) caught when processing request to {s}->https://192.168.99.100:: Connection reset by peer: socket write error
  4. [INFO] ------------------------------------------------------------------------
  5. [INFO] BUILD FAILURE
  6. [INFO] ------------------------------------------------------------------------
  7. [INFO] Total time: 12.700 s
  8. [INFO] Finished at: --19T09::+:
  9. [INFO] Final Memory: 66M/553M
  10. [INFO] ------------------------------------------------------------------------
  11. [ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.2.:build (default-cli) on project authService: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: com.spotify.docker.client.shaded.org.apache.http.client.ClientProtocolException: Cannot retry request with a non-repeatable request entity: Connection reset by peer: socket write error -> [Help ]
  12. [ERROR]
  13. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  14. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  15. [ERROR]
  16. [ERROR] For more information about the errors and possible solutions, please read the following articles:
  17. [ERROR] [Help ] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

我这里image name 等于 “<imageName>${docker.image.prefix}/${project.name}</imageName>” 是两个变量,查看project.name,为“authService" 包含了大写字母,修改为小写即可

9,运行时错误

  1. no main manifest attribute, in /xxxx.war

项目model中pom.xml文件的 build->plugins->plugin节点加入“spring-boot-maven-plugin”

  1. <plugin>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-maven-plugin</artifactId>
  4. </plugin>

注意 不要加载root的 pom.xml中,只能在,启动的 war项目中,否者 没有标记“@SpringBootApplication”的非启动model会报错“repackage failed: Unable to find main class -> [Help 1]”

idea spring boot docker 多项目 maven 编译的更多相关文章

  1. Maven 搭建spring boot多模块项目(附源码),亲测可以,感谢原创

    原创地址:https://segmentfault.com/a/1190000005020589 我的DEMO码云地址,持续添加新功能: https://gitee.com/itbase/Spring ...

  2. Maven 搭建spring boot多模块项目

    Maven 搭建spring boot多模块项目 备注:所有项目都在idea中创建 1.idea创建maven项目 1-1: 删除src,target目录,只保留pom.xml 1-2: 根目录pom ...

  3. Spring Boot Docker 实战

    Spring Boot Docker 开发环境 开发工具: Intellij IDEA 2018.2.6 springboot: 2.0.6.RELEASE jdk: 1.8.0_192 maven: ...

  4. Spring Boot 2.0系列文章(五):Spring Boot 2.0 项目源码结构预览

    关注我 转载请务必注明原创地址为:http://www.54tianzhisheng.cn/2018/04/15/springboot2_code/ 项目结构 结构分析: Spring-boot-pr ...

  5. Spring Boot 多模块项目创建与配置 (一) (转)

    Spring Boot 多模块项目创建与配置 (一) 最近在负责的是一个比较复杂项目,模块很多,代码中的二级模块就有9个,部分二级模块下面还分了多个模块.代码中的多模块是用maven管理的,每个模块都 ...

  6. Spring Boot 多模块项目创建与配置 (一)

    最近在负责的是一个比较复杂项目,模块很多,代码中的二级模块就有9个,部分二级模块下面还分了多个模块.代码中的多模块是用maven管理的,每个模块都使用spring boot框架.之前有零零散散学过一些 ...

  7. 【spring boot】5.spring boot 创建web项目并使用jsp作前台页面

    贼烦的是,使用spring boot 创建web项目,然后我再idea下创建的,but 仅仅启动spring boot的启动类,就算整个项目都是好着的,就算是能够进入controller中,也不能成功 ...

  8. Spring Boot 多模块项目创建与配置 (转)

    转载:https://www.cnblogs.com/MaxElephant/p/8205234.html 最近在负责的是一个比较复杂项目,模块很多,代码中的二级模块就有9个,部分二级模块下面还分了多 ...

  9. 从零一起学Spring Boot之LayIM项目长成记(三) 数据库的简单设计和JPA的简单使用。

    前言 今天是第三篇了,上一篇简单模拟了数据,实现了LayIM页面的数据加载.那么今天呢就要用数据库的数据了.闲言少叙,书归正传,让我们开始吧. 数据库 之前有好多小伙伴问我数据库是怎么设计的.我个人用 ...

随机推荐

  1. header头参数 确定该文件类型

    'chm'=>'application/octet-stream', 'ppt'=>'application/vnd.ms-powerpoint', 'xls'=>'applicat ...

  2. Netty 服务端启动过程

    在 Netty 中创建 1 个 NioServerSocketChannel 在指定的端口监听客户端连接,这个过程主要有以下  个步骤: 创建 NioServerSocketChannel 初始化并注 ...

  3. s21day23 python笔记

    s21day23 python笔记 一.内容回顾及补充 字符串格式化 %s # 示例一:特别注意:最后的右括号前面必须有逗号(,) msg = '我是%s,年龄%s'%('alex',19,) # 元 ...

  4. Byte数组和字符串相互转换的问题

    第一:需求:将文件转成byte数组,之后转成字符串返回.过滤器接收到响应内容后,需要将响应的内容转成byte数组. 第二:我刚开始的做法: Controller:byteArr = Conversio ...

  5. php中include和require的区别(整理)

      require 的使用方法如 require("MyRequireFile.php"); .这个函数通常放在 PHP 程序的最前面,PHP 程序在执行前,就会先读入 requi ...

  6. the status bar issue of react-native Modal on Android ( RN v0.57.0)

    Problem: When use Modal in react-native, the status bar is not included if you make a full-screen ma ...

  7. 洛古 P2568 莫比乌斯+暴力

    #include<bits/stdc++.h> #define LL long long using namespace std; ; bool vis[maxn]; int prime[ ...

  8. SQL group_concat find_in_set 的使用

    SELECT p.id as pid,p.code as code,p.topic_name topic_name,p.vm_id as vm_id,GROUP_CONCAT(iso.iso_name ...

  9. 下一站 java

    一直都在windows的圈子里打滚,偶尔玩玩Linux, Python, Java. 可是最近聊起windows的时候,总是觉得有些不得力,比如说,windows下有IE,MSMQ,IIS,普通使用没 ...

  10. JavaList列表的一些方法

    import java.util.ArrayList;import java.util.Iterator;import java.util.List; public class Test1 { pub ...