refactor: optimize security baseline, task logging, frontend maven packaging, and redirect root page to v2
This commit is contained in:
@@ -18,6 +18,11 @@
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<spring-boot.version>2.7.18</spring-boot.version>
|
||||
<!-- 本地跳过前端构建:mvn clean package -DskipTests -Dskip.frontend.build=true -->
|
||||
<skip.frontend.build>false</skip.frontend.build>
|
||||
<!-- Node.js 下载源地址,默认官方。因网络下载失败时,可配置镜像源,如:-->
|
||||
<!-- -Dnode.download.root=https://npmmirror.com/mirrors/node/ -->
|
||||
<node.download.root>https://nodejs.org/dist/</node.download.root>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -77,6 +82,58 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!--
|
||||
frontend-maven-plugin: 绑定到 prepare-package 阶段。
|
||||
- mvn compile / mvn test:不触发前端构建。
|
||||
- mvn package(含 make up Docker 构建的 Java 侧):
|
||||
Docker 后端阶段已用 -Dskip.frontend.build=true,
|
||||
本地全量打包时自动执行 install-node + npm ci + npm run build。
|
||||
- 跳过:mvn clean package -DskipTests -Dskip.frontend.build=true
|
||||
详见 docs/frontend-build.md。
|
||||
-->
|
||||
<plugin>
|
||||
<groupId>com.github.eirslett</groupId>
|
||||
<artifactId>frontend-maven-plugin</artifactId>
|
||||
<version>1.15.0</version>
|
||||
<configuration>
|
||||
<workingDirectory>frontend-vue</workingDirectory>
|
||||
<skip>${skip.frontend.build}</skip>
|
||||
<nodeDownloadRoot>${node.download.root}</nodeDownloadRoot>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>install-node-and-npm</id>
|
||||
<goals>
|
||||
<goal>install-node-and-npm</goal>
|
||||
</goals>
|
||||
<phase>prepare-package</phase>
|
||||
<configuration>
|
||||
<!-- Node 20 LTS,与 Vite 5.x 兼容 -->
|
||||
<nodeVersion>v20.11.0</nodeVersion>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm-install</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<phase>prepare-package</phase>
|
||||
<configuration>
|
||||
<arguments>ci</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm-build</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<phase>prepare-package</phase>
|
||||
<configuration>
|
||||
<arguments>run build</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user