Browse Source

打包时跳过集成测试

dev-mcp
wanghanlin 4 weeks ago
parent
commit
fa109685d9
  1. 17
      pom.xml

17
pom.xml

@ -175,6 +175,15 @@
</resource> </resource>
</resources> </resources>
<plugins> <plugins>
<!-- 默认跳过集成测试(所有测试均为 @SpringBootTest,需要 DB 和 API Key) -->
<!-- 需要运行测试时显式指定:mvn test -DskipTests=false -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
@ -191,7 +200,8 @@
<!-- ==================== 前端 SDK 构建(client/ → static/sdk/) ==================== --> <!-- ==================== 前端 SDK 构建(client/ → static/sdk/) ==================== -->
<!-- 使用 frontend-maven-plugin 自动安装 Node.js 并编译前端 SDK --> <!-- 使用 frontend-maven-plugin 自动安装 Node.js 并编译前端 SDK -->
<!-- 跳过前端构建:mvn compile -Dskip.frontend=true -->
<!-- 统一绑定到 prepare-package 阶段,mvn compile 不触发,mvn package/install 才构建 -->
<!-- 跳过前端构建:mvn package -Dskip.frontend=true -->
<plugin> <plugin>
<groupId>com.github.eirslett</groupId> <groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId> <artifactId>frontend-maven-plugin</artifactId>
@ -204,6 +214,7 @@
<!-- 第一步:安装 Node.js(仅首次,后续复用 node_modules 缓存) --> <!-- 第一步:安装 Node.js(仅首次,后续复用 node_modules 缓存) -->
<execution> <execution>
<id>install-node-and-npm</id> <id>install-node-and-npm</id>
<phase>prepare-package</phase>
<goals> <goals>
<goal>install-node-and-npm</goal> <goal>install-node-and-npm</goal>
</goals> </goals>
@ -214,6 +225,7 @@
<!-- 第二步:npm install 安装依赖 --> <!-- 第二步:npm install 安装依赖 -->
<execution> <execution>
<id>npm-install</id> <id>npm-install</id>
<phase>prepare-package</phase>
<goals> <goals>
<goal>npm</goal> <goal>npm</goal>
</goals> </goals>
@ -224,6 +236,7 @@
<!-- 第三步:npm run build 编译 SDK --> <!-- 第三步:npm run build 编译 SDK -->
<execution> <execution>
<id>npm-build</id> <id>npm-build</id>
<phase>prepare-package</phase>
<goals> <goals>
<goal>npm</goal> <goal>npm</goal>
</goals> </goals>
@ -241,7 +254,7 @@
<executions> <executions>
<execution> <execution>
<id>copy-sdk-to-static</id> <id>copy-sdk-to-static</id>
<phase>process-resources</phase>
<phase>prepare-package</phase>
<goals> <goals>
<goal>copy-resources</goal> <goal>copy-resources</goal>
</goals> </goals>

Loading…
Cancel
Save