<?xml version="1.0"?>
<!--

    Copyright 2022-2024 benelog GmbH & Co. KG

        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 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>io.openepcis</groupId>
        <artifactId>openepcis-document-validation-parent</artifactId>
        <version>0.9.3</version>
    </parent>
    <artifactId>openepcis-document-validation-service</artifactId>

    <name>openepcis-document-validation-service</name>
    <packaging>jar</packaging>
    <description>Core Library to validate EPCIS 2.0 documents and identifiers.</description>
    <url>https://github.com/openepcis/openepcis-document-validation-service</url>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Sven Boeckelmann</name>
            <email>sven.boeckelmann@benelog.com</email>
            <organization>benelog GmbH &amp; Co. KG</organization>
            <organizationUrl>https://www.benelog.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/openepcis/openepcis-document-validation-service.git</connection>
        <developerConnection>scm:git:ssh://github.com:openepcis/openepcis-document-validation-service.git</developerConnection>
        <url>https://github.com/openepcis/openepcis-document-validation-service/tree/main</url>
    </scm>

    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-core</artifactId>
        </dependency>

        <dependency>
            <groupId>io.openepcis</groupId>
            <artifactId>openepcis-epcis-constants</artifactId>
            <scope>compile</scope>
        </dependency>

        <!--
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-buffer</artifactId>
        </dependency>
        -->
        <!-- lombok Dependency -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>

        <!-- Dependency for validating the JSON Schema -->
        <!-- Jackson ObjectMapper dependency-->
        <dependency>
            <groupId>com.networknt</groupId>
            <artifactId>json-schema-validator</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jackson</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
        </dependency>

        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
        </dependency>

        <!-- Dependency for testing the application -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- Download the epcis-json-schema file from remote during build and place it in resources/json-schema path -->
    <build>
        <plugins>
            <plugin>
                <groupId>com.googlecode.maven-download-plugin</groupId>
                <artifactId>download-maven-plugin</artifactId>
                <version>1.9.0</version>
                <executions>
                    <execution>
                        <!-- the wget goal actually binds itself to this phase by default -->
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <uri>https://ref.gs1.org/standards/epcis/epcis-json-schema.json</uri>
                            <outputFileName>epcis-json-schema.json</outputFileName>
                            <outputDirectory>${project.basedir}/src/main/resources/json-schema</outputDirectory>
                            <overwrite>true</overwrite>
                            <skipCache>false</skipCache>
                            <failOnError>false</failOnError>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
