<?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>com.xishankeji</groupId>
    <artifactId>xsloader4j</artifactId>
    <packaging>pom</packaging>
    <version>1.3.5</version>

    <modules>
        <module>xsloader4j-core</module>
        <module>xsloader4j-spring-boot-embed-starter</module>
        <module>demo-servlet</module>
        <module>demo-spring-boot-main</module>
        <module>demo-spring-boot-servlet</module>
        <module>xsloader4j-maven-plugin</module>
        <module>javet</module>
        <module>javet-lib-node-linux-x86_64</module>
        <module>javet-lib-node-windows-x86_64</module>
        <module>javet-lib-node-macos-x86_64</module>
        <module>javet-lib-v8-macos-x86_64</module>
        <module>javet-lib-v8-linux-x86_64</module>
        <module>javet-lib-v8-windows-x86_64</module>
    </modules>

    <name>xsloader4j</name>
    <description>让java web项目支持JavaScript
        ES6+(ES2015,ES2016,ES2017,ES2018)、*.scss、*.less、*.vue、*.htmv（格式同vue，但可以直接访问）、*.jsx。
    </description>
    <url>https://gitee.com/xishankeji/xsloader4j</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>chenyg</name>
            <email>zggzcyg@qq.com</email>
            <organization>GuiZhouXiShanTechnology</organization>
            <organizationUrl>http://www.xishankeji.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>
            scm:git:git@gitee.com:xishankeji/xsloader4j.git
        </connection>
        <developerConnection>
            scm:git:git@gitee.com:xishankeji/xsloader4j.git
        </developerConnection>
        <url>https://gitee.com/xishankeji/xsloader4j</url>
        <tag>v1.0.x</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <project.OftenPorter.version>1.2.275</project.OftenPorter.version>
        <project.log4j12.version>1.7.32</project.log4j12.version>
        <project.junit.version>4.13.1</project.junit.version>

        <project.spring-boot.version>1.5.22.RELEASE</project.spring-boot.version>
        <project.spring.version>4.3.25.RELEASE</project.spring.version>

        <project.javet.version>1.0.7</project.javet.version>
        <project.nexus-staging-maven-plugin.version>1.6.8</project.nexus-staging-maven-plugin.version>
    </properties>


    <!--发布到私服-->
    <distributionManagement>
        <repository>
            <id>${repo.releases.id}</id>
            <name>Releases</name>
            <url>${repo.releases.url}</url>
        </repository>
        <snapshotRepository>
            <id>${repo.snapshots.id}</id>
            <name>Snapshots</name>
            <url>${repo.snapshots.url}</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${project.junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${project.log4j12.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>


    <build>
        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
            <plugins>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.0.2</version>
                    <configuration>
                        <includeEmptyDirs>true</includeEmptyDirs>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>3.2.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                    <configuration>
                        <deployAtEnd>
                            true
                        </deployAtEnd>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${project.nexus-staging-maven-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin><!-- 用于导出源码 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <!-- 要绑定到的生命周期的阶段 在verify之后，install之前执行下面指定的goal -->
                        <goals>
                            <goal>jar-no-fork</goal>
                            <!-- 类似执行mvn source:jar -->
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includePom>true</includePom>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <!--
  发布命令：mvn clean deploy -P release-oss
  发布被拆分时加入：-Dmaven.test.skip=true -Dmaven.install.skip=true
  https://oss.sonatype.org
  https://oss.sonatype.org/content/repositories/snapshots/
  -->
    <profiles>
        <profile>
            <id>release-oss</id>
            <build>
                <plugins>
                    <!-- Source -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.4</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <includePom>true</includePom>
                        </configuration>
                    </plugin>
                    <!-- Javadoc -->
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <encoding>UTF-8</encoding>
                                    <!--<additionalparam>-Xdoclint:none</additionalparam>-->
                                    <doclint>none</doclint>
                                    <failOnError>false</failOnError>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <encoding>UTF-8</encoding>
                        </configuration>
                    </plugin>
                    <!-- GPG -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>gpg</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${project.nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>${sonatype.id}</serverId>
                            <nexusUrl>${sonatype.nexusUrl}</nexusUrl>
                            <!-- 如果希望发布后自动执行close和release操作，此处可以调整为true -->
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <snapshotRepository>
                    <id>${sonatype.id}</id>
                    <url>${sonatype.snapshots.url}</url>
                </snapshotRepository>
                <repository>
                    <id>${sonatype.id}</id>
                    <url>${sonatype.releases.url}</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>

</project>