<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>
    <artifactId>mapway-doc-ui</artifactId>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <parent>
        <groupId>cn.mapway</groupId>
        <artifactId>mapway-maven</artifactId>
        <version>2.0.2</version>
    </parent>

    <name>mapway-doc-ui</name>
    <description>auto gen doc from api with ui</description>
    <url>http://doc-ui.mapway.cn</url>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/mapway/mapway-doc-ui</url>
    </scm>
    <developers>
        <developer>
            <name>zhangjianshe</name>
            <email>zhangjianshe@gmail.com</email>
        </developer>
    </developers>

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <version>1.5.1.RELEASE</version>
            <optional>true</optional>
        </dependency>
        <!-- markdown support-->
        <dependency>
            <groupId>com.atlassian.commonmark</groupId>
            <artifactId>commonmark</artifactId>
            <version>0.10.0</version>
        </dependency>
        <dependency>
            <groupId>com.atlassian.commonmark</groupId>
            <artifactId>commonmark-ext-gfm-tables</artifactId>
            <version>0.9.0</version>
        </dependency>
        <dependency>
            <groupId>cn.mapway</groupId>
            <artifactId>mapway-annotation</artifactId>
            <version>2.0.0</version>
        </dependency>
        <!-- end markdown support -->
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${SpringVersion}</version>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>dev</id>

            <dependencies>
                <dependency>
                    <groupId>com.google.gwt</groupId>
                    <artifactId>gwt-user</artifactId>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.google.gwt</groupId>
                    <artifactId>gwt-dev</artifactId>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-web</artifactId>
                    <version>${SpringVersion}</version>
                </dependency>
                <dependency>
                    <groupId>com.google.gwt</groupId>
                    <artifactId>gwt-user</artifactId>
                    <scope>compile</scope>
                </dependency>

            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-maven-plugin</artifactId>
                        <version>9.2.8.v20150217</version>
                    </plugin>
                </plugins>

            </build>
        </profile>
        <profile>
            <id>to-enncloud</id>
            <dependencies>
                <dependency>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-web</artifactId>
                    <version>${SpringVersion}</version>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>1.9.1</version>
                        <executions>
                            <execution>
                                <id>timestamp-property</id>
                                <goals>
                                    <goal>timestamp-property</goal>
                                </goals>
                                <configuration>
                                    <name>current.time</name>
                                    <pattern>yyyy年MM月dd日 HH:mm:ss</pattern>
                                    <timeZone>GMT+8</timeZone>
                                </configuration>
                            </execution>
                        </executions>

                    </plugin>

                    <plugin>
                        <groupId>cn.mapway</groupId>
                        <artifactId>mapway-maven-plugin</artifactId>

                        <executions>
                            <execution>
                                <id>write-file</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>write-file</goal>
                                </goals>
                                <configuration>
                                    <charset>UTF-8</charset>
                                    <files>
                                        <file>
                                            <path>src/main/java/cn/mapway/document/parser/CompileVersion.java</path>
                                            <lines>
                                                <line>package cn.mapway.document.parser;</line>
                                                <line>public class CompileVersion {</line>
                                                <line>public final static String VERSION =
                                                    "[${project.version}]@${current.time} from ${env.BRANCH}";
                                                </line>
                                                <line>}</line>
                                            </lines>
                                        </file>
                                    </files>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <version>2.8.0</version>
                        <configuration>
                            <productionMode>true</productionMode>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>compile</phase>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                                <configuration>
                                    <sourceLevel>1.8</sourceLevel>
                                    <warSourceDirectory>src/main/webapp</warSourceDirectory>
                                    <webappDirectory>src/main/webapp</webappDirectory>
                                    <module>cn.mapway.document.ui.ApiDocUi</module>
                                    <force>true</force>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>

                        <executions>
                            <execution>
                                <id>copy-resources</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/classes/cn/mapway/document/resource
                                    </outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>
                                                ${project.basedir}/src/main/webapp/apidoc
                                            </directory>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>

                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


    <properties>
        <java.version>1.8</java.version>
    </properties>
</project>