You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
159 lines
6.2 KiB
159 lines
6.2 KiB
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
<modelVersion>4.0.0</modelVersion> |
|
<parent> |
|
<groupId>org.springframework.boot</groupId> |
|
<artifactId>spring-boot-starter-parent</artifactId> |
|
<version>3.5.8</version> |
|
<relativePath/> <!-- lookup parent from repository --> |
|
</parent> |
|
<groupId>work.xiaohh</groupId> |
|
<artifactId>xiaohh-vue</artifactId> |
|
<version>0.0.1-SNAPSHOT</version> |
|
<name>xiaohh-vue</name> |
|
<description>Demo project for Spring Boot</description> |
|
<url/> |
|
<licenses> |
|
<license/> |
|
</licenses> |
|
<developers> |
|
<developer/> |
|
</developers> |
|
<scm> |
|
<connection/> |
|
<developerConnection/> |
|
<tag/> |
|
<url/> |
|
</scm> |
|
<properties> |
|
<java.version>17</java.version> |
|
</properties> |
|
<dependencies> |
|
<dependency> |
|
<groupId>org.springframework.boot</groupId> |
|
<artifactId>spring-boot-starter-actuator</artifactId> |
|
</dependency> |
|
<dependency> |
|
<groupId>org.springframework.boot</groupId> |
|
<artifactId>spring-boot-starter-data-redis</artifactId> |
|
</dependency> |
|
<dependency> |
|
<groupId>org.springframework.boot</groupId> |
|
<artifactId>spring-boot-starter-web</artifactId> |
|
</dependency> |
|
<dependency> |
|
<groupId>org.mybatis.spring.boot</groupId> |
|
<artifactId>mybatis-spring-boot-starter</artifactId> |
|
<version>3.0.5</version> |
|
</dependency> |
|
|
|
<dependency> |
|
<groupId>com.mysql</groupId> |
|
<artifactId>mysql-connector-j</artifactId> |
|
<scope>runtime</scope> |
|
</dependency> |
|
<dependency> |
|
<groupId>org.springframework.boot</groupId> |
|
<artifactId>spring-boot-starter-test</artifactId> |
|
<scope>test</scope> |
|
</dependency> |
|
<dependency> |
|
<groupId>org.mybatis.spring.boot</groupId> |
|
<artifactId>mybatis-spring-boot-starter-test</artifactId> |
|
<version>3.0.5</version> |
|
<scope>test</scope> |
|
</dependency> |
|
</dependencies> |
|
|
|
<build> |
|
<finalName>${artifactId}</finalName> |
|
<plugins> |
|
<plugin> |
|
<groupId>org.springframework.boot</groupId> |
|
<artifactId>spring-boot-maven-plugin</artifactId> |
|
</plugin> |
|
<plugin> |
|
<groupId>org.codehaus.mojo</groupId> |
|
<artifactId>exec-maven-plugin</artifactId> |
|
<executions> |
|
<!-- 执行 npm install 安装依赖 --> |
|
<execution> |
|
<id>npm-install</id> |
|
<phase>prepare-package</phase> <!-- 在准备包阶段执行 --> |
|
<goals> |
|
<goal>exec</goal> |
|
</goals> |
|
<configuration> |
|
<executable>npm</executable> |
|
<arguments> |
|
<argument>install</argument> |
|
</arguments> |
|
<workingDirectory>${basedir}/src/main/webapp</workingDirectory> |
|
</configuration> |
|
</execution> |
|
<!-- 执行 npm run build 构建项目 --> |
|
<execution> |
|
<id>npm-build</id> |
|
<phase>prepare-package</phase> |
|
<goals> |
|
<goal>exec</goal> |
|
</goals> |
|
<configuration> |
|
<executable>npm</executable> |
|
<arguments> |
|
<argument>run</argument> |
|
<argument>build</argument> |
|
</arguments> |
|
<workingDirectory>${basedir}/src/main/webapp</workingDirectory> |
|
</configuration> |
|
</execution> |
|
</executions> |
|
</plugin> |
|
<plugin> |
|
<groupId>org.apache.maven.plugins</groupId> |
|
<artifactId>maven-resources-plugin</artifactId> |
|
<executions> |
|
<execution> |
|
<id>copy-vue-dist</id> |
|
<phase>prepare-package</phase> |
|
<goals> |
|
<goal>copy-resources</goal> |
|
</goals> |
|
<configuration> |
|
<outputDirectory>${basedir}/src/main/resources/static</outputDirectory> |
|
<resources> |
|
<resource> |
|
<directory>${basedir}/src/main/webapp/dist</directory> |
|
</resource> |
|
</resources> |
|
</configuration> |
|
</execution> |
|
</executions> |
|
</plugin> |
|
<plugin> |
|
<groupId>org.apache.maven.plugins</groupId> |
|
<artifactId>maven-clean-plugin</artifactId> |
|
<configuration> |
|
<filesets> |
|
<!-- 清理最终存放静态资源的目录 --> |
|
<fileset> |
|
<directory>src/main/resources/static</directory> |
|
<includes> |
|
<include>**/*</include> |
|
</includes> |
|
</fileset> |
|
<!-- 清理Vue源码的构建目录 --> |
|
<fileset> |
|
<directory>src/main/webapp/dist</directory> |
|
<includes> |
|
<include>**/*</include> |
|
</includes> |
|
</fileset> |
|
</filesets> |
|
</configuration> |
|
</plugin> |
|
</plugins> |
|
</build> |
|
|
|
</project>
|
|
|