<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>snow-code-generator</artifactId>
        <groupId>cn.lonelysnow</groupId>
        <version>2.2</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>snow-code-generator-ui</artifactId>

    <properties>
        <!--前端打包-->
        <maven-frontend-plugin.version>1.12.1</maven-frontend-plugin.version>
        <maven-frontend-plugin.nodeVersion>v16.16.0</maven-frontend-plugin.nodeVersion>
        <maven-frontend-plugin.npmVersion>8.11.0</maven-frontend-plugin.npmVersion>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>${maven-frontend-plugin.version}</version>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                    </execution>
                    <!-- Install all project dependencies -->
                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                    <!-- Build and minify static files -->
                    <execution>
                        <id>npm run build</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run build</arguments>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <nodeVersion>${maven-frontend-plugin.nodeVersion}</nodeVersion>
                    <npmVersion>${maven-frontend-plugin.npmVersion}</npmVersion>
                    <!-- 若不方便访问官网，可手动设置镜像地址-->
                    <nodeDownloadRoot>https://npm.taobao.org/mirrors/node/</nodeDownloadRoot>
                    <npmDownloadRoot>https://registry.npm.taobao.org/npm/-/</npmDownloadRoot>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>