- pom.xml: - 添加finalName配置去除版本号 - maven-jar-plugin排除资源文件 - 禁用spring-boot-maven-plugin repackage - 各服务移除冗余的plugin配置 - assembly.xml: - 主JAR放根目录(仅服务代码) - lib目录放依赖JAR - start.sh: - 支持java -cp classpath模式启动 - 从service.properties读取MAIN_CLASS - 向后兼容fat jar模式 - service.properties: - 所有服务添加MAIN_CLASS配置 优势: - 主JAR从131MB缩小到103KB - 多服务部署可共享lib目录 - 资源文件外置便于修改
17 lines
398 B
Properties
17 lines
398 B
Properties
# ============================================
|
||
# 服务个性化配置
|
||
# 此文件随服务打包,每个服务独立配置
|
||
# ============================================
|
||
|
||
# 服务名称
|
||
APP_NAME=fund-exp
|
||
|
||
# 主类(启动入口)
|
||
MAIN_CLASS=com.fundplatform.exp.ExpApplication
|
||
|
||
# 实例名称(多租户场景使用,留空则默认等于APP_NAME)
|
||
INSTANCE_NAME=
|
||
|
||
# 租户标识
|
||
TENANT_ID=
|