<?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">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.opengauss</groupId>
	<artifactId>webds-plugin</artifactId>
	<parent>
		<groupId>org.opengauss</groupId>
		<artifactId>visualtool-parent</artifactId>
		<version>${admin.version}</version>
		<relativePath>../../pom.xml</relativePath>
	</parent>
	<packaging>jar</packaging>
	<properties>
		<!-- Compiler properties -->
		<plugin-id>webds-plugin</plugin-id>
		<npm.run.script>build</npm.run.script>
		<web.build.skip>false</web.build.skip>
		<web.clean.skip>false</web.clean.skip>

		<!--project-->
		<java.version>17</java.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>${java.version}</maven.compiler.source>
		<maven.compiler.target>${java.version}</maven.compiler.target>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.xerial</groupId>
			<artifactId>sqlite-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.opengauss</groupId>
			<artifactId>opengauss-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<version>${spring-boot.version}</version>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>org.junit.jupiter</groupId>
					<artifactId>junit-jupiter-engine</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.junit.vintage</groupId>
					<artifactId>junit-vintage-engine</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.opengauss</groupId>
			<artifactId>visualtool-framework</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-starter-data-redis</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-websocket</artifactId>
		</dependency>
		<dependency>
			<groupId>com.gitee.starblues</groupId>
			<artifactId>spring-brick-bootstrap</artifactId>
		</dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opengauss.tool</groupId>
            <artifactId>visualtool-log4j2-desensitize</artifactId>
        </dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
		</dependency>
		<dependency>
			<groupId>jakarta.servlet</groupId>
			<artifactId>jakarta.servlet-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>fastjson</artifactId>
		</dependency>
		<dependency>
			<groupId>cn.hutool</groupId>
			<artifactId>hutool-all</artifactId>
		</dependency>
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>druid-spring-boot-3-starter</artifactId>
		</dependency>
		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jsoup</groupId>
			<artifactId>jsoup</artifactId>
			<version>${jsoup.version}</version>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-inline</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<repositories>
		<repository>
			<id>gitee-eb-repo</id>
			<name>The Maven Repository on Gitee</name>
			<url>https://gitee.com/agile-adept-team/spring-brick-eb/tree/master/maven-repo</url>
		</repository>
	</repositories>


	<pluginRepositories>
		<pluginRepository>
			<id>gitee-eb-repo</id>
			<name>The Maven Repository on Gitee</name>
			<url>https://gitee.com/agile-adept-team/spring-brick-eb/tree/master/maven-repo</url>
		</pluginRepository>
	</pluginRepositories>

	<profiles>
		<profile>
			<id>dev</id>
			<properties>
				<profiles.active>dev</profiles.active>
			</properties>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
		</profile>
		<profile>
			<id>prod</id>
			<properties>
				<profiles.active>prod</profiles.active>
			</properties>
		</profile>
	</profiles>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>com.gitee.starblues</groupId>
					<artifactId>spring-brick-maven-packager</artifactId>
					<version>${spring-brick.version}</version>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<version>${spring-boot.version}</version>
				<configuration>
					<mainClass>com.nctigba.datastudio.DataStudioPluginBootApplication</mainClass>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.gitee.starblues</groupId>
				<artifactId>spring-brick-maven-packager</artifactId>
				<version>${spring-brick.version}</version>
				<configuration>
					<mode>prod</mode>
					<pluginInfo>
						<id>${plugin-id}</id>
						<bootstrapClass>com.nctigba.datastudio.DataStudioPluginApplication</bootstrapClass>
						<version>${project.version}</version>
						<provider>ncti-gba</provider>
						<description>业务开发</description>
					</pluginInfo>
					<loadMainResourcePattern>
						<includes>
							<include>org.intarkdb.**</include>
						</includes>
					</loadMainResourcePattern>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<version>${maven-clean-plugin.version}</version>
				<configuration>
					<filesets>
						<fileset>
							<directory>web-ui/dist</directory>
							<includes>
								<include>**/*</include>
							</includes>
							<followSymlinks>false</followSymlinks>
						</fileset>
						<fileset>
							<directory>${basedir}/src/main/resources/resources</directory>
							<includes>
								<include>**/*</include>
							</includes>
							<followSymlinks>false</followSymlinks>
						</fileset>
					</filesets>
					<skip>${web.clean.skip}</skip>
					<failOnError>true</failOnError>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>${exec-maven-plugin.version}</version>
				<configuration>
					<skip>${build.frontend.skip}</skip>
					<environmentVariables>
						<npm_config_cache>${npm.cache}/data_studio</npm_config_cache>
					</environmentVariables>
				</configuration>
				<executions>
					<execution>
						<id>exec-npm-install</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>exec</goal>
						</goals>
						<configuration>
							<executable>npm</executable>
							<arguments>
								<argument>install</argument>
							</arguments>
							<workingDirectory>web-ui</workingDirectory>
						</configuration>
					</execution>

					<execution>
						<id>exec-npm-run-build</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>exec</goal>
						</goals>
						<configuration>
							<skip>${web.build.skip}</skip>
							<executable>npm</executable>
							<arguments>
								<argument>run</argument>
								<argument>${npm.run.script}</argument>
							</arguments>
							<workingDirectory>web-ui</workingDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<configuration>
					<delimiters>@</delimiters>
					<useDefaultDelimiters>false</useDefaultDelimiters>
				</configuration>
				<version>${maven-resources-plugin.version}</version>
				<executions>
					<execution>
						<id>copy-web</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${basedir}/src/main/resources</outputDirectory>
							<resources>
								<resource>
									<directory>web-ui/dist</directory>
									<targetPath>resources</targetPath>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>${maven-surefire-plugin.version}</version>
				<configuration>
					<skipTests>false</skipTests>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>