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

<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>
    <artifactId>com.io7m.quixote</artifactId>
    <groupId>com.io7m.quixote</groupId>
    <version>1.2.0</version>
  </parent>

  <artifactId>com.io7m.quixote.main</artifactId>

  <name>com.io7m.quixote.main</name>
  <description>Embedded test suite web server (Main)</description>
  <url>https://www.io7m.com/software/quixote</url>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>com.io7m.quixote.core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>com.io7m.quixote.xml</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>com.io7m.blackthorne</groupId>
      <artifactId>com.io7m.blackthorne.core</artifactId>
    </dependency>
    <dependency>
      <groupId>com.io7m.anethum</groupId>
      <artifactId>com.io7m.anethum.slf4j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.io7m.anethum</groupId>
      <artifactId>com.io7m.anethum.api</artifactId>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
    </dependency>

    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.annotation.bundle</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.annotation.versioning</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <!-- Move the CycloneDX plugin execution before assembly construction. -->
        <plugin>
          <groupId>org.cyclonedx</groupId>
          <artifactId>cyclonedx-maven-plugin</artifactId>
          <executions>
            <execution>
              <id>default</id>
              <goals>
                <goal>makeAggregateBom</goal>
              </goals>
              <phase>prepare-package</phase>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <!-- Ignore dependencies that bytecode analysis gets wrong. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <configuration>
          <failOnWarning>true</failOnWarning>
          <ignoredUnusedDeclaredDependencies>
            <ignoredUnusedDeclaredDependency>
              ch.qos.logback:logback-classic:*
            </ignoredUnusedDeclaredDependency>
          </ignoredUnusedDeclaredDependencies>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>distribution</id>
            <goals>
              <goal>single</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/distribution.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>io.github.zlika</groupId>
        <artifactId>reproducible-build-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>reproducible-zip</id>
            <phase>package</phase>
            <goals>
              <goal>strip-jar</goal>
            </goals>
            <configuration>
              <overwrite>true</overwrite>
              <includes>
                <include>.*\.zip</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
