<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2014 - 2024 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-integration</artifactId>
        <groupId>com.blazebit</groupId>
        <version>1.6.11</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <name>Blazebit Persistence Integration Entity-View Spring 6.0</name>
    <artifactId>blaze-persistence-integration-entity-view-spring-6.0</artifactId>
    <packaging>jar</packaging>

    <properties>
        <version.spring>${version.spring-data-3.1-spring}</version.spring>
        <main.java.version>17</main.java.version>
        <module.name>com.blazebit.persistence.integration.view.spring</module.name>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-framework-bom</artifactId>
                <version>${version.spring}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>blaze-persistence-entity-view-api-jakarta</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>blaze-common-utils</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.persistence</groupId>
            <artifactId>jakarta.persistence-api</artifactId>
            <version>${version.jakarta-jpa-api}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.transaction</groupId>
            <artifactId>jakarta.transaction-api</artifactId>
            <version>${version.jakarta-jta}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Test Dependencies -->

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>blaze-persistence-entity-view-impl-jakarta</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
            <version>2.0.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.moditect</groupId>
                <artifactId>moditect-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-module-infos</id>
                        <phase>package</phase>
                        <goals>
                            <goal>add-module-info</goal>
                        </goals>
                        <configuration>
                            <module>
                                <moduleInfoSource>
                                    module ${module.name} {
                                        requires java.sql;
                                        requires java.persistence;
                                        requires spring.core;
                                        requires spring.beans;
                                        requires spring.context;
                                        requires com.blazebit.persistence.view;
                                        exports com.blazebit.persistence.integration.view.spring;
                                        exports com.blazebit.persistence.integration.view.spring.impl to spring.beans;
                                        opens com.blazebit.persistence.integration.view.spring.impl to spring.core, spring.context;
                                        provides com.blazebit.persistence.view.spi.TransactionAccessFactory with com.blazebit.persistence.integration.view.spring.impl.SpringTransactionAccessFactory;
                                    }
                                </moduleInfoSource>
                            </module>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
