<?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>

	<groupId>wiki.thin</groupId>
	<artifactId>thin-wiki-admin-ui</artifactId>
	<version>0.0.1</version>
	<name>thin-wiki-admin</name>
	<description>Thin Wiki Admin</description>
	<url>https://github.com/thin-wiki/thin-wiki-admin</url>

	<properties>
		<java.version>11</java.version>
		<thin-wiki.version>0.0.4</thin-wiki.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<scm>
		<developerConnection>scm:git:git@github.com:thin-wiki/thin-wiki-admin-ui</developerConnection>
		<url>https://github.com/thin-wiki/thin-wiki-admin-ui</url>
		<connection>https://github.com/thin-wiki/thin-wiki-admin-ui.git</connection>
		<tag>HEAD</tag>
	</scm>

	<licenses>
		<license>
			<name>GNU Affero General Public License v3.0</name>
			<url>https://www.gnu.org/licenses/agpl-3.0</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<id>beldon</id>
			<name>beldon</name>
			<email>beldon@vip.qq.com</email>
			<roles>
				<role>Developer</role>
			</roles>
			<timezone>+8</timezone>
		</developer>
	</developers>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

	<repositories>
		<repository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
			<snapshots>
				<updatePolicy>always</updatePolicy>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>

	<build>
		<finalName>thin-wiki-admin-ui</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.2.0</version>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<version>3.1.0</version>
				<configuration>
					<filesets>
						<fileset>
							<directory>${project.basedir}/src/main/resources/static</directory>
						</fileset>
						<fileset>
							<!-- Vue项目打包自动生成的dist目录 -->
							<directory>${project.basedir}/ui/dist</directory>
						</fileset>
					</filesets>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.github.eirslett</groupId>
				<artifactId>frontend-maven-plugin</artifactId>
				<version>1.12.0</version>
				<configuration>
					<workingDirectory>${project.basedir}/ui</workingDirectory>
				</configuration>
				<executions>
					<execution>
						<id>install node and yarn</id>
						<goals>
							<goal>install-node-and-yarn</goal>
						</goals>
						<configuration>
							<nodeVersion>v16.2.0</nodeVersion>
							<yarnVersion>v1.22.10</yarnVersion>
						</configuration>
					</execution>

					<execution>
						<id>yarn install</id>
						<goals>
							<goal>yarn</goal>
						</goals>
						<configuration>
							<arguments>install</arguments>
						</configuration>
					</execution>

					<execution>
						<id>yarn build</id>
						<goals>
							<goal>yarn</goal>
						</goals>
						<configuration>
							<arguments>build</arguments>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!--资源插件，主要为了从前端项目里复制打包好的文件到springboot项目-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<id>copy static</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<!-- 复制前端打包文件到这里 -->
							<outputDirectory>src/main/resources/static/admin</outputDirectory>
							<overwrite>true</overwrite>
							<resources>
								<resource>
									<!-- 从前端打包的目录dist进行指定文件、文件夹内容的复制-->
									<directory>${project.basedir}/ui/dist</directory>
									<includes>
										<!-- 具体根据实际前端代码、及目录结构进行配置-->
										<include>assets/</include>
										<include>resource/</include>
										<include>_app.config.js</include>
										<include>favicon.ico</include>
										<include>index.html</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.5.3</version>
				<configuration>
					<tagNameFormat>v@{project.version}</tagNameFormat>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>3.0.1</version>
				<executions>
					<execution>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<version>1.6.8</version>
				<extensions>true</extensions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>true</autoReleaseAfterClose>
				</configuration>
			</plugin>
		</plugins>
	</build>

</project>
