zoukankan      html  css  js  c++  java
  • Maven多模块打包 #SpringBoot

    三步曲

    SmallArea

        -- distributed-smallarea-common 

        -- distributed-smallarea-service 

            -- user-service (需要打包插件)

        -- store-service(需要打包插件)

    不管是什么模块,打包前

    1、保证良好的关系下,父模块、公共都不需要打包插件,只有能启动的具体模块才需要加插件,即:

    <build>
    <plugins>
    <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <executions> <!--没有它,springboot打包出来的jar运行报错-->
    <execution>
    <goals>
    <goal>repackage</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    <plugin>
    <groupId>com.spotify</groupId>
    <artifactId>dockerfile-maven-plugin</artifactId>
    <version>1.3.6</version>
    <configuration>
    <repository>${project.artifactId}</repository>
    <buildArgs>
    <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
    </buildArgs>
    </configuration>
    </plugin>
    </plugins>
    </build>

    2、然后对要打包的模块的父模块进行安装(有几个父模块就打几个):切换到父模块根目录下执行: mvn clean install   或  mvn -f 指定的位置 clean install 

    3、对公共模块进行安装  ,安装方法根父模块安装方法一样

  • 相关阅读:
    2014最后一篇英语笔记(新开始)
    记录:CSS特殊性——权值规则
    grunt--自动化打包工具使用
    【移动端】---点透事件
    [前端性能提升]--图片转化为base64
    js--cookie
    1.倒数几秒弹窗关闭
    ES6就是ES2015 的主要内容
    call 与 apply的区别
    34枚金币时间管理法
  • 原文地址:https://www.cnblogs.com/zjazn/p/15439825.html
Copyright © 2011-2022 走看看