<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.github.openfeign.querydsl</groupId>
    <artifactId>querydsl-tooling</artifactId>
    <version>7.1</version>
  </parent>

  <artifactId>querydsl-apt</artifactId>
  <name>Querydsl - APT support</name>
  <description>APT based Source code generation for Querydsl</description>

  <dependencies>
    <dependency>
      <groupId>io.github.openfeign.querydsl</groupId>
      <artifactId>querydsl-codegen</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jetbrains</groupId>
      <artifactId>annotations</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.persistence</groupId>
      <artifactId>jakarta.persistence-api</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
    </dependency>

    <!-- provided -->
    <dependency>
      <groupId>dev.morphia.morphia</groupId>
      <artifactId>morphia-core</artifactId>
      <version>${morphia.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- test -->
    <dependency>
      <groupId>org.hibernate.orm</groupId>
      <artifactId>hibernate-core</artifactId>
      <version>${hibernate.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>jakarta.activation</groupId>
          <artifactId>activation-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.javassist</groupId>
          <artifactId>javassist</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hibernate.orm</groupId>
      <artifactId>hibernate-envers</artifactId>
      <version>${hibernate.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign.querydsl</groupId>
      <artifactId>querydsl-core</artifactId>
      <version>${project.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.joda</groupId>
      <artifactId>joda-money</artifactId>
      <version>2.0.2</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.eclipse.jdt</groupId>
      <artifactId>ecj</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.4.2</version>
        <configuration>
          <archive>
            <manifestEntries>
              <Automatic-Module-Name>com.querydsl.apt</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <useSystemClassLoader>false</useSystemClassLoader>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>apt-jars</id>
            <goals>
              <goal>single</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>src/main/general.xml</descriptor>
                <descriptor>src/main/hibernate.xml</descriptor>
                <descriptor>src/main/jakarta.xml</descriptor>
                <descriptor>src/main/jpa.xml</descriptor>
                <descriptor>src/main/morphia.xml</descriptor>
                <descriptor>src/main/onejar.xml</descriptor>
              </descriptors>
              <outputDirectory>${project.build.directory}</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>com.mysema.maven</groupId>
        <artifactId>apt-maven-plugin</artifactId>
        <version>1.1.3</version>
        <executions>
          <execution>
            <goals>
              <goal>test-process</goal>
              <goal>add-test-sources</goal>
            </goals>
            <phase>generate-test-sources</phase>
            <configuration>
              <outputDirectory>target/generated-test-sources/java</outputDirectory>
              <logOnlyOnError>true</logOnlyOnError>
              <processors>
                <processor>com.querydsl.apt.QuerydslAnnotationProcessor</processor>
                <processor>com.querydsl.apt.hibernate.HibernateAnnotationProcessor</processor>
              </processors>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

</project>
