<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>

  <artifactId>jollyday-jaxb</artifactId>
  <name>Jollyday with Jakarta XML Binding (JAXB)</name>

  <description>Jakarta XML Binding (JAXB) based jollyday implementation</description>

  <parent>
    <groupId>de.focus-shift</groupId>
    <artifactId>jollyday</artifactId>
    <version>0.32.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <dependencies>
    <dependency>
      <groupId>de.focus-shift</groupId>
      <artifactId>jollyday-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- JAXB -->
    <dependency>
      <groupId>jakarta.xml.bind</groupId>
      <artifactId>jakarta.xml.bind-api</artifactId>
      <version>4.0.2</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jaxb</groupId>
      <artifactId>jaxb-runtime</artifactId>
      <version>4.0.5</version>
      <scope>runtime</scope>
    </dependency>

    <!-- Threeten -->
    <dependency>
      <groupId>org.threeten</groupId>
      <artifactId>threeten-extra</artifactId>
    </dependency>

    <!-- Test -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <instructions>
            <Bundle-SymbolicName>de.focus_shift.jollyday-jaxb</Bundle-SymbolicName>
            <Export-Package>de.focus_shift.jollyday.jaxb.*</Export-Package>
            <Require-Capability>osgi.extender;filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
            <Provide-Capability>osgi.serviceloader;osgi.serviceloader=de.focus_shift.jollyday.core.spi.ConfigurationService</Provide-Capability>
          </instructions>
        </configuration>
      </plugin>


      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.8.0</version>
        <executions>
          <execution>
            <id>extract-xsd</id>
            <phase>initialize</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <includeArtifactIds>jollyday-core</includeArtifactIds>
              <includes>**/*.xsd</includes>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxb2-maven-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>generate</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>xjc</goal>
            </goals>
            <configuration>
              <target>3.0</target>
              <sources>
                <source>${project.build.directory}/dependency/focus_shift.de/jollyday/schema/holiday/holiday.xsd</source>
              </sources>
              <packageName>de.focus_shift.jollyday.jaxb.mapping</packageName>
              <externalEntityProcessing>true</externalEntityProcessing>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
