<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2023-2026 Philip Helger (www.helger.com)
    philip[at]helger[dot]com

    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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.helger</groupId>
    <artifactId>parent-pom</artifactId>
    <version>3.0.3</version>
  </parent>
  <artifactId>ddd</artifactId>
  <version>0.8.2</version>
  <packaging>bundle</packaging>
  <name>ddd</name>
  <description>Document Details Determinator library</description>
  <url>https://github.com/phax/ddd</url>
  <inceptionYear>2023</inceptionYear>

  <licenses>
    <license>
      <name>Apache 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:https://github.com/phax/ddd.git</connection>
    <developerConnection>scm:git:https://github.com/phax/ddd.git</developerConnection>
    <url>https://github.com/phax/ddd</url>
    <tag>ddd-0.8.2</tag>
  </scm>

  <organization>
    <name>Philip Helger</name>
    <url>http://www.helger.com</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>
  
  <properties>
    <jaxb-plugin.group>org.jvnet.jaxb</jaxb-plugin.group>
    <jaxb-plugin.artifact>jaxb-maven-plugin</jaxb-plugin.artifact>
    <jaxb-plugin.version>4.0.12</jaxb-plugin.version>
    <ph-jaxb-plugin.version>5.1.1</ph-jaxb-plugin.version>
    <phive-rules.version>4.2.0</phive-rules.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.helger.commons</groupId>
        <artifactId>ph-commons-parent-pom</artifactId>
        <version>12.1.3</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.helger.peppol</groupId>
        <artifactId>peppol-commons-parent-pom</artifactId>
        <version>12.3.9</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>com.helger.commons</groupId>
      <artifactId>ph-xml</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger.commons</groupId>
      <artifactId>ph-json</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger.commons</groupId>
      <artifactId>ph-jaxb</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger.commons</groupId>
      <artifactId>ph-jaxb-adapter</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger.peppol</groupId>
      <artifactId>peppol-id</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.commons</groupId>
      <artifactId>ph-unittest-support-ext</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.phive.rules</groupId>
      <artifactId>phive-rules-cii</artifactId>
      <version>${phive-rules.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.phive.rules</groupId>
      <artifactId>phive-rules-ehf</artifactId>
      <version>${phive-rules.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.phive.rules</groupId>
      <artifactId>phive-rules-eracun</artifactId>
      <version>${phive-rules.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.phive.rules</groupId>
      <artifactId>phive-rules-fatturapa</artifactId>
      <version>${phive-rules.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.phive.rules</groupId>
      <artifactId>phive-rules-oioubl</artifactId>
      <version>${phive-rules.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.phive.rules</groupId>
      <artifactId>phive-rules-peppol</artifactId>
      <version>${phive-rules.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.phive.rules</groupId>
      <artifactId>phive-rules-peppol-italy</artifactId>
      <version>${phive-rules.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.phive.rules</groupId>
      <artifactId>phive-rules-simplerinvoicing</artifactId>
      <version>${phive-rules.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.phive.rules</groupId>
      <artifactId>phive-rules-ubl</artifactId>
      <version>${phive-rules.version}</version>
      <scope>test</scope>
    </dependency>
     <dependency>
      <groupId>com.helger.phive.rules</groupId>
      <artifactId>phive-rules-ublbe</artifactId>
      <version>${phive-rules.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.phive.rules</groupId>
      <artifactId>phive-rules-xrechnung</artifactId>
      <version>${phive-rules.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.phive.rules</groupId>
      <artifactId>phive-rules-zugferd</artifactId>
      <version>${phive-rules.version}</version>
      <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>${jaxb-plugin.group}</groupId>
        <artifactId>${jaxb-plugin.artifact}</artifactId>
        <version>${jaxb-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <id>ves</id>
            <configuration>
              <schemaDirectory>${basedir}/src/main/resources/schemas</schemaDirectory>
              <bindingIncludes>
                <bindingInclude>bindings.xjb</bindingInclude>
              </bindingIncludes>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <bindingDirectory>${basedir}/src/main/jaxb</bindingDirectory>
          <extension>true</extension>
          <strict>false</strict>
          <args>
            <arg>-no-header</arg>
            <arg>-quiet</arg>
            <arg>-Xph-default-locale</arg>
            <arg>en_US</arg>
            <arg>-Xph-package-null-marked</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>
          </args>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.helger</groupId>
            <artifactId>ph-jaxb-plugin</artifactId>
            <version>${ph-jaxb-plugin.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Automatic-Module-Name>com.helger.ddd</Automatic-Module-Name>
            <Export-Package>
              com.helger.ddd,
              com.helger.ddd.model,
              com.helger.ddd.model.jaxb,
              com.helger.ddd.model.jaxb.syntax1,
              com.helger.ddd.model.jaxb.vp1
            </Export-Package>
            <Import-Package>!org.jspecify.annotations.*,*</Import-Package>
            <!-- The latter one has precedence -->
            <Include-Resource>{maven-resources},ddd-version.properties=target/classes/ddd-version.properties</Include-Resource>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>de.thetaphi</groupId>
        <artifactId>forbiddenapis</artifactId>
        <configuration>
          <signaturesArtifacts>
            <signaturesArtifact>
              <groupId>com.helger</groupId>
              <artifactId>ph-forbidden-apis</artifactId>
              <version>1.1.1</version>
              <type>jar</type>
              <path>forbidden-apis-java9.txt</path>
            </signaturesArtifact>
          </signaturesArtifacts>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <source>17</source>
          <sourcepath>
            ${project.build.sourceDirectory}:${project.build.directory}/generated-sources/xjc
          </sourcepath>
        </configuration>
      </plugin> 
    </plugins>
  </build>
</project>
