You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# 后端构建环境约定
## 固定 Java 版本
本项目后端固定使用本机 **Java 8( 1.8) ** 构建和打包。不得使用 Java 17 或 Java 21 执行 Maven 构建,也不要把系统默认 Java 版本当作本项目构建版本。
当前开发机 Java 8 路径:
```text
C:\Users\Acer\.jdks\temurin-8\jdk8u502-b07
```
构建前应确认:
```powershell
$env:JAVA_HOME = 'C:\Users\Acer\.jdks\temurin-8\jdk8u502-b07'
$env:Path = " $env:JAVA_HOME \bin; $env:Path "
java -version
```
输出必须是 `1.8.x` 。确认后再执行后端打包:
```powershell
mvn clean package '-Dmaven.test.skip=true'
```
`-Dmaven.test.skip=true` 用于跳过当前项目中不兼容 Java 8 的测试源码编译;生产构建仍会编译主代码并生成 `target\link_commerce-2.7.12.jar` 。
## 发布要求
部署前端和后端时,部署脚本必须继承并校验 Java 8 环境;如果找不到 Java 8, 应直接失败, 禁止回退到 Java 17 或 Java 21。后端构建失败时不得上传或发布旧产物。