<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<parent>
|
<groupId>cn.lihu</groupId>
|
<artifactId>jh</artifactId>
|
<version>${revision}</version>
|
</parent>
|
<modelVersion>4.0.0</modelVersion>
|
|
<artifactId>jh-server</artifactId>
|
<packaging>jar</packaging>
|
|
<name>${project.artifactId}</name>
|
<description>
|
后端 Server 的主项目,通过引入需要 jh-module-xxx 的依赖,
|
从而实现提供 RESTful API 给 jh-ui-admin、jh-ui-user 等前端项目。
|
本质上来说,它就是个空壳(容器)!
|
</description>
|
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
|
<dependencies>
|
<dependency>
|
<groupId>cn.lihu</groupId>
|
<artifactId>jh-module-system-biz</artifactId>
|
<version>${revision}</version>
|
</dependency>
|
<dependency>
|
<groupId>cn.lihu</groupId>
|
<artifactId>jh-module-infra-biz</artifactId>
|
<version>${revision}</version>
|
</dependency>
|
|
<!-- ECG中心。默认注释,保证编译速度 -->
|
<dependency>
|
<groupId>cn.lihu</groupId>
|
<artifactId>jh-module-ecg-biz</artifactId>
|
<version>${revision}</version>
|
</dependency>
|
|
<!-- 会员中心。默认注释,保证编译速度 -->
|
<!-- <dependency>-->
|
<!-- <groupId>cn.lihu</groupId>-->
|
<!-- <artifactId>jh-module-member-biz</artifactId>-->
|
<!-- <version>${revision}</version>-->
|
<!-- </dependency>-->
|
|
<!-- 数据报表。默认注释,保证编译速度 -->
|
<!-- <dependency>-->
|
<!-- <groupId>cn.lihu</groupId>-->
|
<!-- <artifactId>jh-module-report-biz</artifactId>-->
|
<!-- <version>${revision}</version>-->
|
<!-- </dependency>-->
|
<!-- 工作流。默认注释,保证编译速度 -->
|
<!-- <dependency>-->
|
<!-- <groupId>cn.lihu</groupId>-->
|
<!-- <artifactId>jh-module-bpm-biz</artifactId>-->
|
<!-- <version>${revision}</version>-->
|
<!-- </dependency>-->
|
<!-- 支付服务。默认注释,保证编译速度 -->
|
<!-- <dependency>-->
|
<!-- <groupId>cn.lihu</groupId>-->
|
<!-- <artifactId>jh-module-pay-biz</artifactId>-->
|
<!-- <version>${revision}</version>-->
|
<!-- </dependency>-->
|
|
<!-- 微信公众号模块。默认注释,保证编译速度 -->
|
<!-- <dependency>-->
|
<!-- <groupId>cn.lihu</groupId>-->
|
<!-- <artifactId>jh-module-mp-biz</artifactId>-->
|
<!-- <version>${revision}</version>-->
|
<!-- </dependency>-->
|
|
<!-- 商城相关模块。默认注释,保证编译速度-->
|
<!-- <dependency>-->
|
<!-- <groupId>cn.lihu</groupId>-->
|
<!-- <artifactId>jh-module-promotion-biz</artifactId>-->
|
<!-- <version>${revision}</version>-->
|
<!-- </dependency>-->
|
<!-- <dependency>-->
|
<!-- <groupId>cn.lihu</groupId>-->
|
<!-- <artifactId>jh-module-product-biz</artifactId>-->
|
<!-- <version>${revision}</version>-->
|
<!-- </dependency>-->
|
<!-- <dependency>-->
|
<!-- <groupId>cn.lihu</groupId>-->
|
<!-- <artifactId>jh-module-trade-biz</artifactId>-->
|
<!-- <version>${revision}</version>-->
|
<!-- </dependency>-->
|
<!-- <dependency>-->
|
<!-- <groupId>cn.lihu</groupId>-->
|
<!-- <artifactId>jh-module-statistics-biz</artifactId>-->
|
<!-- <version>${revision}</version>-->
|
<!-- </dependency>-->
|
|
<!-- CRM 相关模块。默认注释,保证编译速度 -->
|
<!-- <dependency>-->
|
<!-- <groupId>cn.lihu</groupId>-->
|
<!-- <artifactId>jh-module-crm-biz</artifactId>-->
|
<!-- <version>${revision}</version>-->
|
<!-- </dependency>-->
|
|
<!-- ERP 相关模块。默认注释,保证编译速度 -->
|
<!-- <dependency>-->
|
<!-- <groupId>cn.lihu</groupId>-->
|
<!-- <artifactId>jh-module-erp-biz</artifactId>-->
|
<!-- <version>${revision}</version>-->
|
<!-- </dependency>-->
|
|
<!-- AI 大模型相关模块。默认注释,保证编译速度 -->
|
<!-- <dependency>-->
|
<!-- <groupId>cn.lihu</groupId>-->
|
<!-- <artifactId>jh-module-ai-biz</artifactId>-->
|
<!-- <version>${revision}</version>-->
|
<!-- </dependency>-->
|
|
<!-- spring boot 配置所需依赖 -->
|
<dependency>
|
<groupId>org.springframework.boot</groupId>
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
<optional>true</optional>
|
</dependency>
|
|
<!-- 服务保障相关 -->
|
<dependency>
|
<groupId>cn.lihu</groupId>
|
<artifactId>jh-spring-boot-starter-protection</artifactId>
|
</dependency>
|
|
<dependency>
|
<groupId>org.springframework.cloud</groupId>
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
<version>${openfeign.version}</version>
|
</dependency>
|
|
<!--
|
<dependency>
|
<groupId>org.springframework.boot</groupId>
|
<artifactId>spring-boot-devtools</artifactId>
|
<scope>runtime</scope>
|
<optional>true</optional>
|
</dependency>
|
-->
|
|
</dependencies>
|
|
<build>
|
<!-- 设置构建的 jar 包名 -->
|
<finalName>${project.artifactId}</finalName>
|
|
<!--
|
合并部署:把 ecg_web 的前端构建产物打进 jar。
|
|
· 目标目录选 META-INF/resources/frontend 而非 static:
|
META-INF/resources 是 Servlet 3.0 标准静态资源目录,Spring Boot
|
默认会扫描;额外加一层 frontend/ 前缀,便于后端用
|
addResourceHandlers 精确控制"哪些 URL 交给前端",
|
不影响后端已有的 /doc.html、/druid/**、/profile/** 等路径。
|
见 cn.lihu.jh.server.ecg.FrontendResourceConfig。
|
|
· 产物目录由 profile 注入的 env.VITE_OUT_DIR 决定,
|
默认 dist-merged(对应 ecg_web 的 `pnpm build:merged`)。
|
|
· 注意:本模块【不】引入 frontend-maven-plugin。
|
前端构建请在部署前单独执行(cd ecg_web && pnpm build:merged),
|
避免后端构建强依赖 node/pnpm,也避免构建机需要外网下载 node。
|
-->
|
<resources>
|
<!-- 保留原有的后端资源(application*.yaml、logback-spring.xml 等) -->
|
<resource>
|
<directory>src/main/resources</directory>
|
<filtering>false</filtering>
|
</resource>
|
<!-- 新增:前端产物 -->
|
<resource>
|
<directory>${project.basedir}/../../ecg_web/${env.VITE_OUT_DIR}</directory>
|
<targetPath>META-INF/resources/frontend</targetPath>
|
<filtering>false</filtering>
|
</resource>
|
</resources>
|
|
<plugins>
|
<!-- 打包 -->
|
<plugin>
|
<groupId>org.springframework.boot</groupId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
<version>${spring.boot.version}</version>
|
<executions>
|
<execution>
|
<goals>
|
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
|
</goals>
|
</execution>
|
</executions>
|
</plugin>
|
</plugins>
|
</build>
|
|
<!--
|
前端产物目录的选择。env.VITE_OUT_DIR 会被上面 <resources> 引用。
|
|
· frontend-merged(默认):使用 ecg_web 执行 `pnpm build:merged` 产出的
|
dist-merged,对应"前端打进 jar、与后端同源"的合并部署模式。
|
· frontend-prod:回退到原有的 dist-prod。若前端仍由 nginx 独立托管
|
(即不做合并部署),用 -P frontend-prod 激活此 profile 即可,
|
此时 jar 内不含前端,行为与改造前一致。
|
-->
|
<profiles>
|
<profile>
|
<id>frontend-merged</id>
|
<activation>
|
<activeByDefault>true</activeByDefault>
|
</activation>
|
<properties>
|
<env.VITE_OUT_DIR>dist-merged</env.VITE_OUT_DIR>
|
</properties>
|
</profile>
|
<profile>
|
<id>frontend-prod</id>
|
<properties>
|
<env.VITE_OUT_DIR>dist-prod</env.VITE_OUT_DIR>
|
</properties>
|
</profile>
|
</profiles>
|
|
</project>
|