<?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>ums</artifactId>
        <groupId>top.dcenter</groupId>
        <version>1.1.4</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>ums-demo</artifactId>
    <version>1.1.4</version>
    <packaging>pom</packaging>

    <modules>
        <module>quickStart</module>
        <module>basic-example</module>
        <module>basic-detail-example</module>
        <module>session-detail-example</module>
        <module>social-simple-example</module>
        <module>social-detail-example</module>
        <module>validate-code-example</module>
        <module>permission-example</module>
        <module>demo</module>
    </modules>


    <url>https://github.com/ZeroOrInfinity/UMS/tree/master/demo</url>

    <name>ums-demo</name>
    <description>用户管理脚手架(ums) ums-demo: 详细的 example 请查看各个子模块</description>

    <profiles>
        <!--默认开启dev-->
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <profileActive>dev</profileActive>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <version>3.2.0</version>
                        <configuration>
                            <excludes>
                                <exclude>**/*.properties</exclude>
                                <exclude>**/*.yml</exclude>
                            </excludes>
                            <archive>
                                <manifest>
                                    <!--运行jar包时运行的主类，要求类全名-->
                                    <mainClass>demo.security.DemoApplication</mainClass>
                                    <!-- 是否指定项目classpath下的依赖 -->
                                    <addClasspath>true</addClasspath>
                                    <!-- 指定依赖的时候声明前缀 -->
                                    <classpathPrefix>./lib/</classpathPrefix>
                                </manifest>
                            </archive>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>2.6</version>
                        <configuration>
                            <finalName>ums-demo</finalName>
                            <appendAssemblyId>true</appendAssemblyId>
                            <descriptors>
                                <!--配置描述文件路径-->
                                <descriptor>assembly.xml</descriptor>
                            </descriptors>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id>
                                <!-- 绑定到package生命周期阶段上 -->
                                <phase>package</phase>
                                <goals>
                                    <!-- 只运行一次 -->
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.8</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <tasks>
                                        <move file="${project.build.directory}/original-${project.artifactId}-${top.dcenter.version}.jar"
                                              tofile="${project.build.directory}/${project.artifactId}-${top.dcenter.version}.jar" />
                                    </tasks>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>test</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <profileActive>test</profileActive>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <version>3.2.0</version>
                        <configuration>
                            <excludes>
                                <exclude>**/*.properties</exclude>
                                <exclude>**/*.yml</exclude>
                            </excludes>
                            <archive>
                                <manifest>
                                    <!--运行jar包时运行的主类，要求类全名-->
                                    <mainClass>demo.security.DemoApplication</mainClass>
                                    <!-- 是否指定项目classpath下的依赖 -->
                                    <addClasspath>true</addClasspath>
                                    <!-- 指定依赖的时候声明前缀 -->
                                    <classpathPrefix>./lib/</classpathPrefix>
                                </manifest>
                            </archive>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>2.6</version>
                        <configuration>
                            <finalName>ums-demo</finalName>
                            <appendAssemblyId>true</appendAssemblyId>
                            <descriptors>
                                <!--配置描述文件路径-->
                                <descriptor>assembly.xml</descriptor>
                            </descriptors>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id>
                                <!-- 绑定到package生命周期阶段上 -->
                                <phase>package</phase>
                                <goals>
                                    <!-- 只运行一次 -->
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.8</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <tasks>
                                        <move file="${project.build.directory}/original-${project.artifactId}-${top.dcenter.version}.jar"
                                              tofile="${project.build.directory}/${project.artifactId}-${top.dcenter.version}.jar" />
                                    </tasks>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>prod</id>
            <properties>
                <profileActive>prod</profileActive>
            </properties>
        </profile>
    </profiles>

</project>