<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>nl.vpro.poms</groupId>
    <artifactId>poms-shared-parent</artifactId>
    <version>5.12.7</version>
  </parent>

  <groupId>nl.vpro.media</groupId>
  <artifactId>media-domain</artifactId>
  <name>media-domain</name>
  <description>
    The basic domain classes for 'media', the core of POMS. Also the 'update' XML bindings for it.
    It also contains some closely related domain classes like the enum to contain NICAM kijkwijzer settings.
  </description>

  <build>
    <plugins>
      <plugin>
        <!-- see https://intellij-support.jetbrains.com/hc/en-us/community/posts/206842215-Hibernate-JPA-2-Metamodel-generation -->
        <!--  "Store generated sources relative to:" select Module content root." -->
        <groupId>org.bsc.maven</groupId>
        <artifactId>maven-processor-plugin</artifactId>
        <executions>
          <execution>
            <id>process</id>
            <goals>
              <goal>process</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <processors>
                <!-- https://stackoverflow.com/questions/31805327/how-to-cohexist-lombok-and-jpametalmodel-processors-with-maven -->
                <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor</processor>
              </processors>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-jpamodelgen</artifactId>
            <version>${hibernate.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <!-- this seems to help eclipse understand that generated-sources/apt is a source dir? -->
      <!-- https://stackoverflow.com/questions/10735380/define-additional-source-directory-in-maven ? -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/apt</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>nl.vpro.image</groupId>
      <artifactId>image-domain</artifactId>
    </dependency>
    <dependency>
      <groupId>nl.vpro.shared</groupId>
      <artifactId>vpro-shared-xml</artifactId>
    </dependency>
    <dependency>
      <groupId>nl.vpro.shared</groupId>
      <artifactId>vpro-shared-util</artifactId>
    </dependency>
    <dependency>
      <groupId>nl.vpro.shared</groupId>
      <artifactId>vpro-shared-validation</artifactId>
    </dependency>
    <dependency>
      <groupId>nl.vpro.shared</groupId>
      <artifactId>vpro-shared-jackson2</artifactId>
    </dependency>
    <dependency>
      <groupId>nl.vpro.user</groupId>
      <artifactId>user-domain</artifactId>
    </dependency>
    <dependency>
      <groupId>nl.vpro.media</groupId>
      <artifactId>media-classification</artifactId>
    </dependency>
    <dependency>
      <groupId>org.meeuw.i18n</groupId>
      <artifactId>i18n-regions-countries</artifactId>
    </dependency>
    <dependency>
      <groupId>org.meeuw.i18n</groupId>
      <artifactId>i18n-regions-subdivisions</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.module</groupId>
      <artifactId>jackson-module-jaxb-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.annotation</groupId>
      <artifactId>javax.annotation-api</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.hibernate.validator</groupId>
      <artifactId>hibernate-validator</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <!--
      This dependency is afaik only relevant for annotations, hence it can be optional
      Nicer would be to drop it altogether
      -->
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <!-- contains javax.persistence -->
      <groupId>javax</groupId>
      <artifactId>javaee-api</artifactId>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>com.sun.mail</groupId>
          <artifactId>javax.mail</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>nl.vpro.shared</groupId>
      <artifactId>vpro-shared-persistence</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-matchers</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.sf.json-lib</groupId>
      <artifactId>json-lib</artifactId>
      <classifier>jdk15</classifier>
      <scope>test</scope>
    </dependency>
    <!-- This is needed to let hibernate validation work, it somewhy needs an el-implementation -->
    <dependency>
      <groupId>org.glassfish.web</groupId>
      <artifactId>javax.el</artifactId>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>nl.vpro.shared</groupId>
      <artifactId>vpro-shared-test</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
    </dependency>
    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjweaver</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.meeuw</groupId>
      <artifactId>jaxb-documentation</artifactId>
      <optional>true</optional>
    </dependency>
  </dependencies>
</project>
