<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2014 - 2021 Blazebit.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->
<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">
    <parent>
        <artifactId>blaze-persistence-examples-showcase-fragments</artifactId>
        <groupId>com.blazebit</groupId>
        <version>1.6.3</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <name>Blazebit Persistence Examples Showcase Fragments Basic</name>
    <artifactId>blaze-persistence-examples-showcase-fragments-basic</artifactId>

    <properties>
        <module.name>com.blazebit.persistence.examples.showcase.fragments.basic</module.name>
    </properties>

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.blazebit</groupId>
            <artifactId>blaze-persistence-examples-showcase-spi</artifactId>
        </dependency>
        <dependency>
            <groupId>com.blazebit</groupId>
            <artifactId>blaze-persistence-examples-showcase-base</artifactId>
        </dependency>
        <dependency>
            <groupId>com.blazebit</groupId>
            <artifactId>blaze-persistence-entity-view-api</artifactId>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>hibernate-apt</id>
            <dependencies>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-entity-view-processor</artifactId>
                    <version>${project.version}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <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>
                                    <!-- source output directory -->
                                    <outputDirectory>${project.build.directory}/metamodel</outputDirectory>
                                    <processors>
                                        <processor>com.blazebit.persistence.view.processor.EntityViewAnnotationProcessor</processor>
                                    </processors>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <!-- Metamodel -->
                            <dependency>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>blaze-persistence-entity-view-processor</artifactId>
                                <version>${project.version}</version>
                            </dependency>
                            <dependency>
                                <groupId>jakarta.xml.bind</groupId>
                                <artifactId>jakarta.xml.bind-api</artifactId>
                                <version>${version.jaxb-api}</version>
                            </dependency>
                            <dependency>
                                <groupId>com.sun.xml.bind</groupId>
                                <artifactId>jaxb-impl</artifactId>
                                <version>${version.jaxb}</version>
                            </dependency>
                            <dependency>
                                <groupId>jakarta.transaction</groupId>
                                <artifactId>jakarta.transaction-api</artifactId>
                                <version>${version.jta}</version>
                            </dependency>
                            <dependency>
                                <groupId>jakarta.activation</groupId>
                                <artifactId>jakarta.activation-api</artifactId>
                                <version>${version.activation}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source-metamodel</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${project.build.directory}/metamodel</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>