<?xml version="1.0" encoding="UTF-8"?>
<!--

    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="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>eu.de4a.ial</groupId>
    <artifactId>ial-parent-pom</artifactId>
    <version>0.1.7</version>
  </parent>
  <artifactId>ial-api</artifactId>
  <packaging>bundle</packaging>
  <name>ial-api</name>
  <url>https://github.com/de4a-wp5/ial-service/ial-api</url>
  <inceptionYear>2022</inceptionYear>

  <licenses>
    <license>
      <name>Apache 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <organization>
    <name>de4a</name>
    <url>http://www.de4a.eu</url>
  </organization>

  <developers>
    <developer>
      <id>philip</id>
      <name>Philip Helger</name>
      <email>ph(at)helger.com</email>
      <url>http://www.helger.com</url>
    </developer>
  </developers>

  <dependencies>
    <dependency>
      <groupId>com.helger.commons</groupId>
      <artifactId>ph-jaxb</artifactId>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>
    <!-- JUnit 4 for testing -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <!-- Don't specify the targetPath because this leads to a broken JAR file 
        in combination with the bundle plugin (absolute file paths in ZIP file) -->
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*.properties</include>
        </includes>
      </resource>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <filtering>false</filtering>
        <excludes>
          <exclude>**/*.properties</exclude>
        </excludes>  
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <configuration>
          <instructions>
            <Automatic-Module-Name>eu.de4a.ial.api</Automatic-Module-Name>
            <Export-Package>eu.de4a.ial.api.*</Export-Package>
            <Import-Package>!javax.annotation.*,*</Import-Package>
            <!-- The latter one has precedence -->
            <Include-Resource>{maven-resources},ial-version.properties=target/classes/ial-version.properties</Include-Resource>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <doclint>none</doclint>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/LICENSE</exclude>
            <exclude>**/NOTICE</exclude>
            <exclude>**/*.txt</exclude>
            <exclude>src/main/resources/schemas/**</exclude>
            <exclude>src/test/resources/**</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.evolvedbinary.maven.jvnet</groupId>
        <artifactId>jaxb2-maven-plugin</artifactId>
        <version>0.15.0</version>
        <executions>
          <execution>
            <id>core</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <schemaIncludes>
                <schemaInclude>*.xsd</schemaInclude>
              </schemaIncludes>
              <bindingIncludes>
                <bindingInclude>bindings-ial.xjb</bindingInclude>
              </bindingIncludes>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <schemaDirectory>${basedir}/src/main/resources/schemas</schemaDirectory>
          <bindingDirectory>${basedir}/src/main/jaxb</bindingDirectory>
          <catalog>src/main/jaxb/catalog.txt</catalog>
          <extension>true</extension>
          <strict>false</strict>
          <verbose>false</verbose>
          <args>
            <arg>-no-header</arg>
            <arg>-Xph-default-locale</arg>
            <arg>en_US</arg>
            <arg>-Xph-annotate</arg>
            <arg>-Xph-fields-private</arg>
            <arg>-Xph-code-quality</arg>
            <arg>-Xph-equalshashcode</arg>
            <arg>-Xph-tostring</arg>
            <arg>-Xph-list-extension</arg>
            <arg>-Xph-csu</arg>
            <arg>-Xph-cloneable2</arg>
            <arg>-Xph-value-extender</arg>
            <arg>-Xph-offset-dt-extension</arg>
          </args>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.helger</groupId>
            <artifactId>ph-jaxb22-plugin</artifactId>
            <version>2.3.3.3</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
</project>
