<?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>quick-code</artifactId>
        <groupId>cn.ablxyw</groupId>
        <version>1.0.3</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>quick-code-db</artifactId>

    <dependencies>
        <!--quick-code-core-->
        <dependency>
            <groupId>cn.ablxyw</groupId>
            <artifactId>quick-code-core</artifactId>
        </dependency>
        <!--mysql-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!--oracle-->
        <dependency>
            <groupId>com.hynnet</groupId>
            <artifactId>oracle-driver-ojdbc</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!--postgresql-->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!--druid-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
        </dependency>
        <!--mybatis-plus-->
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
        </dependency>
        <!--spring-boot-starter-freemarker-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-freemarker</artifactId>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>package</id>
            <activation>
                <jdk>${java.version}</jdk>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <configuration>
                            <archive>
                                <manifest>
                                    <!--运行jar包时运行的主类，要求类全名-->
                                    <mainClass>cn.ablxyw.QuickFrameDbApplication</mainClass>
                                    <!-- 是否指定项目classpath下的依赖 -->
                                    <addClasspath>true</addClasspath>
                                    <!-- 指定依赖的时候声明前缀 -->
                                    <classpathPrefix>lib/</classpathPrefix>
                                </manifest>
                                <manifestEntries>
                                    <Class-Path>./</Class-Path>
                                </manifestEntries>
                            </archive>
                            <excludes>
                                <exclude>config/*</exclude>
                                <exclude>db/*</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <!--打包时跳过测试类-->
                            <skipTests>true</skipTests>
                            <useSystemClassLoader>false</useSystemClassLoader>
                            <systemPropertyVariables>
                                <sun.net.http.allowRestrictedHeaders>true</sun.net.http.allowRestrictedHeaders>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <source>${java.version}</source>
                            <target>${java.version}</target>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <configuration>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>src/main/assembly/assembly.xml</descriptor>
                            </descriptors>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <build>
        <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
        <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
    </build>
</project>
