SpringBoot多模块打包

最近写了个app想测试下之前写的服务端,打包时候发现问题,卡了一个小时,做下记录避免下次再卡;
坑1:
多模块中common 包需要install 那怎么install呢
因为一直都是用idea mvn的图形界面 不知道什么时候点了


image.png

结果一直在plugins 一直点install 一直安装不上

应该点的是Lifecycle 中的install

image.png

坑2:
多模块中父pom.xml不应该有build节点
需要打包的的模块中应该有相应的build节点
也就是下图


image.png
    <build>
        <finalName>watch_user</finalName>
        <plugins>
            <!-- Srping Boot 打包工具 -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.1.5.RELEASE</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- 指定JDK编译版本 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

坑3:
父模块要install下

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容