1. 项目结构
2. 父项目dom
org.springframework.boot spring-boot-maven-plugin com.bigben.logsystem.web.LogSystemApplication ZIP repackage
3. web项目dom
org.springframework.boot spring-boot-maven-plugin
4. api子项目dom
因为api子模块被其他两个模块所引用,所以要加上一些配置,避免打包其他模块是重复打包此模块。
org.springframework.boot spring-boot-maven-plugin true
5. component子项目dom
org.springframework.boot spring-boot-maven-plugin true
6. 打包操作
如果整体打包出问题的话,尝试一下每个模块单独打包。
7. 运行
在自己的maven库中找到刚刚打包的jar包(可以在打包生成的日志中找到保存的路径)
进入web模块中,找到jar包
使用cmd,进入此目录,运行
java -jar xxx.jar
运行成功!