<!--
  ~ Copyright 2020 Hazelcast Inc.
  ~
  ~ Licensed under the Hazelcast Community License (the "License"); you may not use
  ~ this file except in compliance with the License. You may obtain a copy of the
  ~ License at
  ~
  ~ http://hazelcast.com/hazelcast-community-license
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  ~ WARRANTIES 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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.hazelcast</groupId>
        <artifactId>hazelcast-hibernate5-parent</artifactId>
        <version>2.0.0</version>
    </parent>

    <artifactId>hazelcast-hibernate53</artifactId>
    <packaging>jar</packaging>
    <description>Hazelcast In-Memory DataGrid Hibernate Plugin</description>
    <url>http://www.hazelcast.com/</url>

    <properties>
        <hibernate.core.version>5.3.7.Final</hibernate.core.version>
        <jdk.version>1.8</jdk.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <bytebuddy.version>1.8.17</bytebuddy.version>
        <!-- needed for checkstyle/findbugs -->
        <main.basedir>${project.parent.basedir}</main.basedir>
    </properties>

    <build>
        <!-- Overlay code onto hibernate5 module -->
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven.resources.plugin.version}</version>
                <executions>
                    <execution>
                        <id>copy-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
                            <overwrite>false</overwrite>
                            <resources>
                                <resource>
                                    <directory>../hazelcast-hibernate5/src/main/java</directory>
                                    <excludes>
                                        <exclude>com/hazelcast/hibernate/AbstractHazelcastCacheRegionFactory.java</exclude>
                                        <exclude>com/hazelcast/hibernate/HazelcastCacheRegionFactory.java</exclude>
                                        <exclude>com/hazelcast/hibernate/HazelcastLocalCacheRegionFactory.java</exclude>
                                        <exclude>com/hazelcast/hibernate/RegionCache.java</exclude>
                                        <exclude>com/hazelcast/hibernate/distributed/IMapRegionCache.java</exclude>
                                        <exclude>com/hazelcast/hibernate/local/LocalRegionCache.java</exclude>
                                        <exclude>com/hazelcast/hibernate/local/TimestampsRegionCache.java</exclude>
                                        <exclude>com/hazelcast/hibernate/access/**.java</exclude>
                                        <exclude>com/hazelcast/hibernate/region/**.java</exclude>
                                        <exclude>com/hazelcast/hibernate/serialization/Hibernate5CacheEntrySerializerHook.java</exclude>
                                        <exclude>com/hazelcast/hibernate/serialization/Hibernate5CacheEntrySerializer.java</exclude>
                                        <exclude>com/hazelcast/hibernate/serialization/Hibernate51CacheEntrySerializer.java</exclude>
                                    </excludes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/classes</outputDirectory>
                            <overwrite>false</overwrite>
                            <resources>
                                <resource>
                                    <directory>../hazelcast-hibernate5/src/main/resources</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-test-sources</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/generated-test-sources</outputDirectory>
                            <overwrite>false</overwrite>
                            <resources>
                                <resource>
                                    <directory>../hazelcast-hibernate5/src/test/java</directory>
                                    <excludes>
                                        <exclude>com/hazelcast/hibernate/CacheHitMiss*Test.java</exclude>
                                        <exclude>com/hazelcast/hibernate/CustomPropertiesTest.java</exclude>
                                        <exclude>com/hazelcast/hibernate/NaturalIdTest.java</exclude>
                                        <exclude>com/hazelcast/hibernate/RegionFactoryDefaultSlowTest.java</exclude>
                                        <exclude>com/hazelcast/hibernate/RegionFactoryDefaultTest.java</exclude>
                                        <exclude>com/hazelcast/hibernate/Topic*Test.java</exclude>
                                        <exclude>com/hazelcast/hibernate/access/**.java</exclude>
                                        <exclude>com/hazelcast/hibernate/region/**.java</exclude>
                                        <exclude>com/hazelcast/hibernate/local/LocalRegionCacheTest.java</exclude>
                                        <exclude>com/hazelcast/hibernate/local/TimestampsRegionCacheTest.java</exclude>
                                        <exclude>com/hazelcast/hibernate/serialization/HibernateSerializationHookNonAvailableTest.java</exclude>
                                    </excludes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-test-resources</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
                            <overwrite>false</overwrite>
                            <resources>
                                <resource>
                                    <directory>../hazelcast-hibernate5/src/test/resources</directory>
                                    <excludes>
                                        <exclude>hazelcast-custom.xml</exclude>
                                    </excludes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>${build.helper.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>generate-test-sources</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-test-sources</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration combine.self="override">
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    <runOrder>failedfirst</runOrder>
                    <argLine>
                        -Xms128m -Xmx1G -XX:MaxPermSize=128M
                        -Dhazelcast.phone.home.enabled=false
                        -Dhazelcast.mancenter.enabled=false
                        -Dhazelcast.logging.type=none
                        -Dhazelcast.test.use.network=false
                    </argLine>
                    <excludes>
                        <exclude>**/HibernateSerializationHookAvailableTest.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>