
<!--
  ~ Copyright (c) 2016 Network New Technologies Inc.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ You may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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.networknt</groupId>
    <artifactId>light-spring-boot</artifactId>
    <version>1.5.32</version>
    <packaging>pom</packaging>
    <name>Parent POM</name>
    <description>Light 4J Framework Spring Boot Components</description>
    <url>https://github.com/networknt/light-spring-boot</url>

    <developers>
        <developer>
            <id>stevehu</id>
            <name>Steve Hu</name>
            <email>stevehu@gmail.com</email>
        </developer>
    </developers>

    <issueManagement>
        <system>github</system>
        <url>https://github.com/networknt/light-spring-boot/issues</url>
    </issueManagement>

    <licenses>
        <license>
            <name>Apache License Version 2.0</name>
            <url>http://repository.jboss.org/licenses/apache-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git://github.com:networknt/light-spring-boot.git</connection>
        <developerConnection>scm:git://github.com:networknt/light-spring-boot.git</developerConnection>
        <url>https://github.com:networknt/light-spring-boot.git</url>
    </scm>

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

    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <version.light-4j>1.5.32</version.light-4j>
        <version.slf4j>1.7.25</version.slf4j>
        <version.logback>1.2.3</version.logback>
        <version.junit>4.12</version.junit>
        <version.spring-boot>2.1.3.RELEASE</version.spring-boot>
        <version.undertow>2.0.16.Final</version.undertow>
        <version.maven-version>2.7</version.maven-version>
        <version.nexus-staging-maven>1.6.8</version.nexus-staging-maven>
        <version.maven-source>3.0.1</version.maven-source>
        <version.maven-surefire>2.22.1</version.maven-surefire>
        <!--<version.maven-release>2.5.3</version.maven-release>-->
        <version.maven-javadoc>2.10.4</version.maven-javadoc>
        <version.jacoco>0.7.9</version.jacoco>
        <version.maven-compiler>3.6.1</version.maven-compiler>
        <version.build-helper-maven>1.9.1</version.build-helper-maven>
        <version.plexus-compiler-javac-errorprone>2.8</version.plexus-compiler-javac-errorprone>
        <version.error_prone_core>2.0.15</version.error_prone_core>
        <version.lifecycle-mapping>1.0.0</version.lifecycle-mapping>
        <version.maven-gpg>1.6</version.maven-gpg>
        <argLine>-Xmx512m</argLine>
    </properties>

    <modules>
        <module>spring-servlet</module>
        <!--
        <module>spring-reactive</module>
        -->
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- Modules in this project -->
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>spring-servlet</artifactId>
                <version>${project.version}</version>
            </dependency>
            <!--
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>spring-reactive</artifactId>
                <version>${project.version}</version>
            </dependency>
            -->
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>handler</artifactId>
                <version>${version.light-4j}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>exception</artifactId>
                <version>${version.light-4j}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>metrics</artifactId>
                <version>${version.light-4j}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>correlation</artifactId>
                <version>${version.light-4j}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>traceability</artifactId>
                <version>${version.light-4j}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>openapi-meta</artifactId>
                <version>${version.light-4j}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>openapi-security</artifactId>
                <version>${version.light-4j}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>openapi-validator</artifactId>
                <version>${version.light-4j}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>sanitizer</artifactId>
                <version>${version.light-4j}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>health</artifactId>
                <version>${version.light-4j}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>info</artifactId>
                <version>${version.light-4j}</version>
            </dependency>
            <dependency>
                <groupId>com.networknt</groupId>
                <artifactId>specification</artifactId>
                <version>${version.light-4j}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot</artifactId>
                <version>${version.spring-boot}</version>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>io.undertow</groupId>
                <artifactId>undertow-servlet</artifactId>
                <version>${version.undertow}</version>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${version.slf4j}</version>
            </dependency>

            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${version.logback}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${version.junit}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
        <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>${basedir}/src/main/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <filtering>false</filtering>
                <directory>${basedir}/src/test/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
            </testResource>
        </testResources>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>${version.maven-version}</version>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${version.nexus-staging-maven}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <!--
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>${version.maven-release}</version>
			</plugin>
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${version.maven-source}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${version.maven-javadoc}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.maven-surefire}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>${version.maven-surefire}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${version.maven-surefire}</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>${version.build-helper-maven}</version>
                <executions>
                    <execution>
                        <id>add-test-source</id>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}\src\integration\java</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-test-resource</id>
                        <goals>
                            <goal>add-test-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <!-- Don't forget <directory> label -->
                                    <directory>${project.basedir}\src\integration\resources</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- JACOCO added for code coverage -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${version.jacoco}</version>
                <executions>
                    <!-- The Executions for unit tests -->
                    <execution>
                        <id>pre-unit-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>post-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
                            <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                        </configuration>
                    </execution>
                    <!-- End Executions for unit tests -->
                    <!-- The Executions for integration tests -->
                    <execution>
                        <id>pre-integration-test</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>post-integration-test</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <dataFile>${project.build.directory}/coverage-reports/jacoco-it.exec</dataFile>
                            <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                        </configuration>
                    </execution>
                    <!-- End Executions for integration tests -->
                </executions>
            </plugin>
            <!-- end JACOCO -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${version.maven-compiler}</version>
                <configuration>
                    <compilerId>javac-with-errorprone</compilerId>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                    <compilerArgs>
                        <!-- add command line validation here -->
                    </compilerArgs>
                    <forceJavacCompilerUse>true</forceJavacCompilerUse>
                    <!-- maven-compiler-plugin defaults to targeting Java 5, but our javac
                         only supports >=6 -->
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-javac-errorprone</artifactId>
                        <version>${version.plexus-compiler-javac-errorprone}</version>
                    </dependency>
                    <!-- override plexus-compiler-javac-errorprone's dependency on
                         Error Prone with the latest version -->
                    <dependency>
                        <groupId>com.google.errorprone</groupId>
                        <artifactId>error_prone_core</artifactId>
                        <version>${version.error_prone_core}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
        <pluginManagement>
        	<plugins>
        		<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        		<plugin>
        			<groupId>org.eclipse.m2e</groupId>
        			<artifactId>lifecycle-mapping</artifactId>
        			<version>${version.lifecycle-mapping}</version>
        			<configuration>
        				<lifecycleMappingMetadata>
        					<pluginExecutions>
        						<pluginExecution>
        							<pluginExecutionFilter>
        								<groupId>
        									org.apache.maven.plugins
        								</groupId>
        								<artifactId>
        									maven-compiler-plugin
        								</artifactId>
        								<versionRange>
        									[3.3,)
        								</versionRange>
        								<goals>
        									<goal>compile</goal>
        									<goal>testCompile</goal>
        								</goals>
        							</pluginExecutionFilter>
        							<action>
        								<ignore></ignore>
        							</action>
        						</pluginExecution>
        						<pluginExecution>
        							<pluginExecutionFilter>
        								<groupId>org.jacoco</groupId>
        								<artifactId>
        									jacoco-maven-plugin
        								</artifactId>
        								<versionRange>
        									[0.7.4.201502262128,)
        								</versionRange>
        								<goals>
        									<goal>prepare-agent</goal>
        								</goals>
        							</pluginExecutionFilter>
        							<action>
        								<ignore></ignore>
        							</action>
        						</pluginExecution>
        					</pluginExecutions>
        				</lifecycleMappingMetadata>
        			</configuration>
        		</plugin>
        	</plugins>
        </pluginManagement>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>${version.maven-surefire}</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>dev</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${version.jacoco}</version>
                        <executions>
                            <!-- The Executions for merging -->
                            <execution>
                                <id>merge-results</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>merge</goal>
                                </goals>
                                <configuration>
                                    <fileSets>
                                        <fileSet>
                                            <directory>${project.build.directory}/coverage-reports</directory>
                                            <includes>
                                                <include>*.exec</include>
                                            </includes>
                                        </fileSet>
                                    </fileSets>
                                    <destFile>${project.build.directory}/coverage-reports/aggregate.exec</destFile>
                                </configuration>
                            </execution>
                            <execution>
                                <id>post-merge-report</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <dataFile>${project.build.directory}/coverage-reports/aggregate.exec</dataFile>
                                    <outputDirectory>${project.reporting.outputDirectory}/jacoco-aggregate</outputDirectory>
                                </configuration>
                            </execution>
                            <!-- End Executions for merging -->
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${version.maven-gpg}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
