美文网首页
SpringBoot多模块打包

SpringBoot多模块打包

作者: 姑娘请别为难小僧 | 来源:发表于2019-08-14 16:05 被阅读0次

最近写了个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下

相关文章

网友评论

      本文标题:SpringBoot多模块打包

      本文链接:https://www.haomeiwen.com/subject/inzgjctx.html