<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright (c) 2020, 2021 Contributors to the Eclipse Foundation
   
    See the NOTICE file(s) distributed with this work for additional
    information regarding copyright ownership.
   
    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License 2.0 which is available at
    http://www.eclipse.org/legal/epl-2.0
   
    SPDX-License-Identifier: EPL-2.0
 -->
<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">
  <parent>
    <groupId>org.eclipse.hono</groupId>
    <artifactId>hono-services</artifactId>
    <version>1.9.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>hono-service-device-registry-base</artifactId>
  <name>Hono Service Device Registry Base</name>
  <description>Base classes for implementing a Hono device registry.</description>
  <url>https://www.eclipse.org/hono</url>

  <properties>
    <docker.skip>true</docker.skip>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.eclipse.hono</groupId>
      <artifactId>hono-service-base</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-crypto</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.annotation</groupId>
      <artifactId>javax.annotation-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.hono</groupId>
      <artifactId>hono-client-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.hono</groupId>
      <artifactId>hono-client-telemetry</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>io.opentracing</groupId>
      <artifactId>opentracing-noop</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.bol</groupId>
      <artifactId>cryptvault</artifactId>
      <optional>true</optional>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-junit5</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!--
        Copy legal documents from "target/classes" folder to "target/test-classes" folder
        so that we make sure to include legal docs in test jar.
       -->
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.basedir}/src/main/resources</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy_legal_docs_for_test_jar</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.testOutputDirectory}/META-INF</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.outputDirectory}/META-INF</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <exclude>logback-test.xml</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
