<!--
  ~ 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>json-schema-validator</artifactId>
    <version>1.0.81</version>
    <packaging>bundle</packaging>
    <description>A json schema validator that supports draft v4, v6, v7, v2019-09 and v2020-12</description>
    <url>https://github.com/networknt/json-schema-validator</url>
    <name>JsonSchemaValidator</name>
    <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/json-schema-validator/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/json-schema-validator.git</connection>
        <developerConnection>scm:git://github.com:networknt/json-schema-validator.git</developerConnection>
        <url>https://github.com:networknt/json-schema-validator.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>
        <java.testversion>1.8</java.testversion>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <version.jackson>2.14.2</version.jackson>
        <version.slf4j>2.0.7</version.slf4j>
        <version.common-lang3>3.12.0</version.common-lang3>
        <version.joni>2.1.41</version.joni>
        <version.logback>1.2.11</version.logback>
        <version.junit>5.9.2</version.junit>
        <version.hamcrest>2.2</version.hamcrest>
        <version.undertow>2.2.24.Final</version.undertow>
        <version.itu>1.7.0</version.itu>
        <version.surefire>3.0.0</version.surefire>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${version.jackson}</version>
        </dependency>
        <dependency>
          <groupId>com.fasterxml.jackson.dataformat</groupId>
          <artifactId>jackson-dataformat-yaml</artifactId>
          <version>${version.jackson}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${version.slf4j}</version>
        </dependency>
        <!--
        Commons lang slated for removal but kept for projects that accidentally depend on it
        through accidental transitive runtime dependencies.

        For projects that depend on it for compile they will get an immediate failure as the
        scope is now runtime instead of compile.
        -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${version.common-lang3}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jruby.joni</groupId>
            <artifactId>joni</artifactId>
            <optional>true</optional>
            <version>${version.joni}</version>
        </dependency>
        <dependency>
            <groupId>com.ethlo.time</groupId>
            <artifactId>itu</artifactId>
            <version>${version.itu}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${version.logback}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${version.junit}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${version.junit}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${version.hamcrest}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.undertow</groupId>
            <artifactId>undertow-core</artifactId>
            <version>${version.undertow}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <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>
            <testResource>
                <directory>${project.basedir}/src/test/suite</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>5.1.8</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Import-Package>
                            org.jcodings;resolution:=optional,
                            org.jcodings.specific;resolution:=optional,
                            org.joni;resolution:=optional,
                            org.joni.exception;resolution:=optional,
                            *
                        </Import-Package>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</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>2.5.3</version></plugin>
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</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>3.4.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <source>8</source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <testSource>${java.testversion}</testSource>
                    <testTarget>${java.testversion}</testTarget>
                </configuration>
                <executions>
                    <execution>
                        <id>test-compile</id>
                        <phase>process-test-sources</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <source>${java.testversion}</source>
                            <target>${java.testversion}</target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.surefire}</version>
                <configuration>
                    <argLine>@{argLine} -Duser.language=en -Duser.region=GB</argLine>
                    <reportFormat>plain</reportFormat>
                    <consoleOutputReporter>
                        <disable>true</disable>
                    </consoleOutputReporter>
                    <statelessTestsetReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
                        <usePhrasedTestSuiteClassName>true</usePhrasedTestSuiteClassName>
                        <usePhrasedTestCaseClassName>true</usePhrasedTestCaseClassName>
                        <usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
                    </statelessTestsetReporter>
                    <statelessTestsetInfoReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
                        <usePhrasedClassNameInRunning>true</usePhrasedClassNameInRunning>
                        <usePhrasedClassNameInTestCaseSummary>true</usePhrasedClassNameInTestCaseSummary>
                    </statelessTestsetInfoReporter>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>me.fabriciorby</groupId>
                        <artifactId>maven-surefire-junit5-tree-reporter</artifactId>
                        <version>1.1.0</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.8</version>
                <executions>
                    <!-- Prepares the property pointing to the JaCoCo
                    runtime agent which is passed as VM argument when Maven the Surefire plugin
                    is executed. -->
                    <execution>
                        <id>pre-unit-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>

                    <!-- Ensures that the code coverage report for
                    unit tests is created after unit tests have been run. -->
                    <execution>
                        <id>post-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>${version.surefire}</version>
            </plugin>
        </plugins>
    </reporting>
    <profiles>
        <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>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>java-module</id>
            <activation>
                <jdk>[9,)</jdk>
            </activation>
            <build>
                <plugins>
        			<plugin>
        				<groupId>org.moditect</groupId>
        				<artifactId>moditect-maven-plugin</artifactId>
        				<version>1.0.0.RC3</version>
        				<executions>
        					<execution>
        						<id>add-module-infos</id>
        						<phase>package</phase>
        						<goals>
        							<goal>add-module-info</goal>
        						</goals>
        						<configuration>
        							<jvmVersion>9</jvmVersion>
        							<overwriteExistingFiles>true</overwriteExistingFiles>
        							<module>
        								<moduleInfo>
        									<name>com.networknt.schema</name>
        									<!-- export everything -->
        									<exports>*;</exports>
        									<!-- declare services consumed by the artifact -->
        									<addServiceUses>true</addServiceUses>
        								</moduleInfo>
        							</module>
                                    <!--
                                       previously configured but commented out
                                    <module>
                                        <moduleInfoSource>
                                            module com.networknt.schema {
                                                requires transitive com.fasterxml.jackson.databind;
                                                requires org.apache.commons.lang3;
                                                requires org.jruby.jcodings;
                                                requires org.jruby.joni;
                                                requires org.slf4j;
                    
                                                exports com.networknt.schema;
                                                exports com.networknt.schema.format;
                                                exports com.networknt.schema.uri;
                                                exports com.networknt.schema.urn;
                                            }
                                        </moduleInfoSource>
                                    </module>
                                    -->
        							<jdepsExtraArgs>
        								<arg>--multi-release=9</arg>
        							</jdepsExtraArgs>
        						</configuration>
        					</execution>
        				</executions>
        			</plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
