1. 去掉zlt-web的父级依赖,为一个独立模块;因为目前这个依赖了“frontend-maven-plugin”打包可能会有问题,导致整个项目都打包不了,所以前端按需独立打包。

2. 增加build.bat和start.bat快捷方式
This commit is contained in:
zhult13
2022-10-22 17:06:38 +08:00
parent 0903f12403
commit fccb0a7700
222 changed files with 13597 additions and 13690 deletions
+50 -120
View File
@@ -1,126 +1,56 @@
<?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"
<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">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<modules>
<module>react-web</module>
</modules>
<parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.zlt</groupId>
<artifactId>central-platform</artifactId>
<artifactId>zlt-web</artifactId>
<version>5.4.0</version>
</parent>
<artifactId>zlt-web</artifactId>
<description>前端</description>
<description>前端</description>
<packaging>pom</packaging>
<properties>
<node.version>v16.13.2</node.version>
<yarn.version>v1.22.19</yarn.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<executions>
<execution>
<id>install node and yarn</id>
<goals>
<goal>install-node-and-yarn</goal>
</goals>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
<yarnVersion>${yarn.version}</yarnVersion>
<installDirectory>src/main/frontend</installDirectory>
</configuration>
</execution>
<execution>
<id>yarn install</id>
<phase>generate-resources</phase>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>install</arguments>
<workingDirectory>src/main/frontend</workingDirectory>
</configuration>
</execution>
<execution>
<id>yarn run build</id>
<phase>compile</phase>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>run build</arguments>
<workingDirectory>src/main/frontend</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<includeEmptyDirs>true</includeEmptyDirs>
</configuration>
<executions>
<execution>
<id>copy</id>
<phase>compile</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/frontend/dist</directory>
<targetPath>META-INF/central-platform-ui</targetPath>
<filtering>false</filtering>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>noNode</id>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>8</java.version>
<spring-boot-dependencies.version>2.5.14</spring-boot-dependencies.version>
<docker-maven-plugin.version>1.2.2</docker-maven-plugin.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot-dependencies.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot-dependencies.version}</version>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<modules>
<!-- Layui开发的前端 -->
<module>layui-web</module>
<!-- React开发的前端(Ant Design) -->
<module>react-web</module>
</modules>
</project>