Java spring-boot 多模块modules打包jar

在项目主入口模块中添加下面的maven插件

这是打包配置,其它的依赖模块不需要配置

<build>
   <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
    <finalName>项目名</finalName>
</build>

点开右侧的maven面板,这里有好多目录,选择你项目的根目录那个,(我的是最下面)。选中clean和install,再点击上面绿色的运行按钮(M旁边)

稍微等待一下就可以看到打包好的文件了
在这里插入图片描述

打包回生成很多target文件夹,找到主入口所在的目录的target下面的xxx.jar文件,这就是打包好的文件(其它的target不需要)

猜你喜欢

转载自blog.csdn.net/sunyv1/article/details/107143571