<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.github.jcechace.apicurio-model-generator</groupId>
  <artifactId>kubernetes-apicurio-registry-model</artifactId>
  <version>a5c02b71</version>
  <packaging>bundle</packaging>
  <name>Fabric8 :: Kubernetes Model :: Code Generator :: Apicurio Registry</name>
  <scm>
    <connection>scm:git://github.com/jcechace/apicurio-model-generator.git</connection>
    <developerConnection>scm:git://github.com/jcechace/apicurio-model-generator.git</developerConnection>
    <tag>a5c02b710b77f7d60b29e28da9fb111817af8d1d</tag>
    <url>git://github.com/jcechace/apicurio-model-generator.git</url>
  </scm>
  <properties>
    <jsonschema2pojo.version>1.1.0</jsonschema2pojo.version>
    <lombok.version>1.18.18</lombok.version>
    <clone-kube>true</clone-kube>
    <maven.bundle.plugin.version>4.2.1</maven.bundle.plugin.version>
    <fabric8.kubernetes-client.version>5.2.1</fabric8.kubernetes-client.version>
    <sundrio.version>0.24.3</sundrio.version>
    <maven.compiler.target>11</maven.compiler.target>
    <maven.antrun.plugin.version>3.0.0</maven.antrun.plugin.version>
    <maven.buildhelper.plugin.version>3.1.0</maven.buildhelper.plugin.version>
    <maven.compiler.source>11</maven.compiler.source>
  </properties>
  <dependencies>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>kubernetes-model-core</artifactId>
      <version>${fabric8.kubernetes-client.version}</version>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>kubernetes-model-common</artifactId>
      <version>${fabric8.kubernetes-client.version}</version>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>${lombok.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.sundr</groupId>
      <artifactId>builder-annotations</artifactId>
      <version>${sundrio.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>tools</artifactId>
          <groupId>com.sun</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.sundr</groupId>
      <artifactId>transform-annotations</artifactId>
      <version>${sundrio.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>central</id>
      <url>https://repo1.maven.org/maven2</url>
    </repository>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>gradle-workaround</id>
      <url>https://repo.spring.io/plugins-release</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <url>https://repo1.maven.org/maven2</url>
    </pluginRepository>
    <pluginRepository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>gradle-workaround</id>
      <url>https://repo.spring.io/plugins-release</url>
    </pluginRepository>
  </pluginRepositories>
  <build>
    <plugins>
      <plugin>
        <groupId>org.jsonschema2pojo</groupId>
        <artifactId>jsonschema2pojo-maven-plugin</artifactId>
        <version>${jsonschema2pojo.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>model-annotator</artifactId>
            <version>${fabric8.kubernetes-client.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <customAnnotator>io.fabric8.kubernetes.ModelAnnotator</customAnnotator>
          <sourcePaths>
            <sourcePath>${project.basedir}/src/main/resources/schema/model-schema.json</sourcePath>
          </sourcePaths>
          <targetPackage>io.apicurio.registry.operator.api.model</targetPackage>
          <includeConstructors>true</includeConstructors>
          <includeJsr303Annotations>false</includeJsr303Annotations>
          <includeToString>false</includeToString>
          <includeHashcodeAndEquals>false</includeHashcodeAndEquals>
          <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>${maven.bundle.plugin.version}</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
            <Import-Package>*</Import-Package>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${maven.buildhelper.plugin.version}</version>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>${project.build.outputDirectory}/schema/model-schema.json</file>
                  <type>json</type>
                  <classifier>schema</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>${maven.antrun.plugin.version}</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <echo>removing the duplicate generated class</echo>
                <delete verbose="true">
                  <fileset dir="${project.build.directory}/generated-sources">
                    <include name="*.java" />
                  </fileset>
                </delete>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
