fundplatform/pom.xml
zhangjf 2184dce6a8 refactor: 优化打包结构,主JAR放入lib目录并带版本号
- pom.xml: 移除finalName配置,JAR保留版本号
- assembly.xml: 主JAR放入lib目录(useProjectArtifact=true)
- start.sh: 简化启动逻辑
  - ClassPath统一为 lib/*
  - 无需单独匹配主JAR文件名
  - 只需配置MAIN_CLASS即可启动

优势:
- 主JAR带版本号便于版本识别和升级
- 所有JAR统一放lib目录,结构清晰
- 启动脚本更简洁,无需APP_NAME匹配JAR
2026-02-22 20:30:28 +08:00

145 lines
5.2 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- 作为整个资金服务平台的父工程(聚合 + 继承) -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.0</version>
<relativePath/>
</parent>
<groupId>com.fundplatform</groupId>
<artifactId>fundplatform</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>fundplatform</name>
<description>Fund Service Platform - Parent</description>
<modules>
<module>fund-common</module>
<module>fund-gateway</module>
<module>fund-sys</module>
<module>fund-cust</module>
<module>fund-proj</module>
<module>fund-req</module>
<module>fund-exp</module>
<module>fund-receipt</module>
<module>fund-report</module>
<module>fund-file</module>
</modules>
<properties>
<java.version>21</java.version>
<spring-cloud.version>2023.0.0</spring-cloud.version>
<spring-cloud-alibaba.version>2023.0.0.0-RC1</spring-cloud-alibaba.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- Spring Cloud -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Spring Cloud Alibaba -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring-cloud-alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- 公共依赖 - 所有模块都需要的依赖 -->
<dependencies>
<!-- Spring Boot Actuator - 健康检查和监控端点 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Micrometer Prometheus - Prometheus 监控指标暴露 -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
</dependencies>
<!-- 项目内自定义 Maven 仓库配置,避免依赖外部 settings.xml 中的私服配置 -->
<repositories>
<!-- 官方中央仓库 -->
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<!-- 公共构建配置 - 所有服务模块继承 -->
<build>
<plugins>
<!-- Maven JAR Plugin - 打包普通JAR排除资源文件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
<!-- 排除资源文件资源文件通过assembly打包到conf目录 -->
<excludes>
<exclude>**/*.yml</exclude>
<exclude>**/*.yaml</exclude>
<exclude>**/*.properties</exclude>
<exclude>**/*.xml</exclude>
<exclude>**/*.json</exclude>
</excludes>
</configuration>
</plugin>
<!-- Spring Boot Maven Plugin - 禁用repackage生成普通JAR -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>${project.artifactId}</finalName>
<!-- 禁用repackage不生成fat jar -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>