<?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>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <groupId>run.mone</groupId>
    <artifactId>spring-context-support</artifactId>
    <version>1.0.10-mone</version>

    <name>${project.artifactId}</name>
    <description>The parent project of jcommon</description>
    <url>https://github.com/XiaoMi/mone</url>
    <inceptionYear>2020</inceptionYear>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <spring.framework.version>3.2.18.RELEASE</spring.framework.version>
        <maven.jcommonDirectory>~/</maven.jcommonDirectory>
    </properties>

    <scm>
        <connection>git@github.com:alibaba/spring-context-support.git</connection>
        <developerConnection>git@github.com:alibaba/spring-context-support.git</developerConnection>
        <url>https://github.com/alibaba/spring-context-support</url>
    </scm>

    <developers>

        <developer>
            <id>mercyblitz</id>
            <name>Mercy Ma</name>
            <email>mercyblitz@gmail.com</email>
            <url>https://github.com/mercyblitz/</url>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>

    </developers>

    <dependencies>

        <!-- Spring Framework -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.framework.version}</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.framework.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.1.1</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>spring-4.0</id>
            <properties>
                <spring.framework.version>4.0.9.RELEASE</spring.framework.version>
            </properties>
        </profile>

        <profile>
            <id>spring-4.1</id>
            <properties>
                <spring.framework.version>4.1.9.RELEASE</spring.framework.version>
            </properties>
        </profile>

        <profile>
            <id>spring-4.2</id>
            <properties>
                <spring.framework.version>4.2.9.RELEASE</spring.framework.version>
            </properties>
        </profile>

        <profile>
            <id>spring-4.3</id>
            <properties>
                <spring.framework.version>4.3.29.RELEASE</spring.framework.version>
            </properties>
        </profile>

        <profile>
            <id>spring-5.0</id>
            <properties>
                <spring.framework.version>5.0.19.RELEASE</spring.framework.version>
            </properties>
        </profile>

        <profile>
            <id>spring-5.1</id>
            <properties>
                <spring.framework.version>5.1.18.RELEASE</spring.framework.version>
            </properties>
        </profile>

        <profile>
            <id>spring-5.2</id>
            <properties>
                <spring.framework.version>5.3.29</spring.framework.version>
            </properties>
        </profile>

    </profiles>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>copy-license</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/classes/META-INF</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${maven.jcommonDirectory}</directory>
                                    <includes>
                                        <include>LICENSE.txt</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <fork>false</fork>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.0.0</version>
                <executions>
                    <execution>
                        <id>license-check</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-third-party</goal>
                        </goals>
                        <configuration>
                            <includeOptional>false</includeOptional>
                            <useMissingFile>false</useMissingFile>
                            <failOnMissing>false</failOnMissing>
                            <licenseMerges>
                                <licenseMerge>Apache License, Version 2.0|The Apache Software License, Version
                                    2.0|ASF 2.0|Apache 2|Apache-2.0|Apache 2.0 License|Apache 2.0|Apache License v2.0|Apache License 2.0|The Apache License, Version 2.0|The Apache Software License, Version 2.0
                                </licenseMerge>
                                <licenseMerge>The MIT License|MIT License</licenseMerge>
                                <licenseMerge>The 3-Clause BSD License|New BSD License|3-Clause BSD
                                    License|BSD|3-Clause BSD License|The New BSD License
                                </licenseMerge>
                            </licenseMerges>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- To package the source code, you need to add this plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.5.0</version>
                <configuration>
                    <failOnError>false</failOnError>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <configuration>
                            <executable>gpg</executable>
                            <keyname>330CB139ECDEC8C703A5947BA1FF844D032E41DD</keyname>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>