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

    <groupId>org.simpleflatmapper</groupId>
    <artifactId>sfm-parent</artifactId>
    <version>2.7.2</version>
    <packaging>pom</packaging>

    <name>sfm-parent</name>
    <url>http://github.com/arnaudroger/SimpleFlatMapper</url>

    <description>Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low
        footprint.
    </description>

    <developers>
        <developer>
            <id>arnaudroger</id>
            <name>Arnaud Roger</name>
            <email>arnaud.roger@gmail.com</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>The MIT License (MIT)</name>
            <url>http://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>scm:git:git://github.com/arnaudroger/SimpleFlatMapper.git</url>
        <connection>scm:git:git://github.com/arnaudroger/SimpleFlatMapper.git</connection>
        <developerConnection>scm:git:git@github.com:arnaudroger/SimpleFlatMapper.git</developerConnection>
        <tag>sfm-parent-2.7.2</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <source.classifier>sources</source.classifier>
        <javadoc.classifier>javadoc</javadoc.classifier>
        <jar.classifier />
    </properties>

    <modules>
        <module>sfm</module>
        <module>sfm-datastax</module>
        <module>sfm-jooq</module>
        <module>sfm-poi</module>
        <module>sfm-querydsl</module>
        <module>sfm-springjdbc</module>
        <module>sfm-test</module>
  </modules>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.3</version>
                    <configuration>
                        <classifier>${javadoc.classifier}</classifier>
                        <header>
                            <![CDATA[<a href="http://www.simpleflatmapper.org">SimpleFlatMapper</a> hosted on <a href="https://github.com/arnaudroger/SimpleFlatMapper">GitHub</a>]]>
                        </header>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <dependencies>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>2.0.2-beta</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <profiles>
        <profile>
            <id>travis</id>
            <activation>
                <property>
                    <name>env.TRAVIS</name>
                    <value>true</value>
                </property>
                <jdk>1.8</jdk>
            </activation>

            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.jacoco</groupId>
                            <artifactId>jacoco-maven-plugin</artifactId>
                            <version>0.7.5.201505241946</version>
                            <executions>
                                <execution>
                                    <id>prepare-agent</id>
                                    <goals>
                                        <goal>prepare-agent</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.eluder.coveralls</groupId>
                        <artifactId>coveralls-maven-plugin</artifactId>
                        <version>4.1.0</version>
                        <configuration>
                            <jacocoReports>
                                <param>${project.reporting.outputDirectory}/${project.version}/jacoco</param>
                            </jacocoReports>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk16</id>
            <activation>
                <jdk>1.6</jdk>
            </activation>
            <properties>
                <source.classifier>jdk16-sources</source.classifier>
                <maven.javadoc.skip>true</maven.javadoc.skip>
                <jar.classifier>jdk16</jar.classifier>
            </properties>

            <build>
                <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>com.google.code.maven-replacer-plugin</groupId>
                        <artifactId>replacer</artifactId>
                        <version>1.5.2</version>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>replace</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <includes>
                                <include>src/main/java/org/sfm/**/*</include>
                                <include>src/test/java/org/sfm/**/*</include>
                                <include>*/src/main/java/org/sfm/**/*</include>
                                <include>*/src/test/java/org/sfm/**/*</include>
                            </includes>
                            <excludes>
                                <exclude>target/**</exclude>
                            </excludes>
                            <replacements>
                                <replacement>
                                    <token>//IFJAVA8_START</token>
                                    <value>/*IFJAVA8_START</value>
                                </replacement>
                                <replacement>
                                    <token>//IFJAVA8_END</token>
                                    <value>IFJAVA8_END*/</value>
                                </replacement>
                            </replacements>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.3</version>
                        <configuration>
                            <source>1.6</source>
                            <target>1.6</target>
                            <excludes>
                                <exclude>**/org/sfm/**/*Spliterator*</exclude>
                                <exclude>**/org/sfm/**/*Optional*</exclude>
                                <exclude>**/org/sfm/**/time/*</exclude>
                            </excludes>
                        </configuration>

                        <executions>
                            <execution>
                                <id>default-testCompile</id>
                                <phase>test-compile</phase>
                                <configuration>
                                    <testExcludes>
                                        <exclude>**/org/sfm/tuples/fasttuple/**/*</exclude>
                                        <exclude>**/org/sfm/tuples/jool/**/*</exclude>
                                        <exclude>**/org/sfm/**/*Optional*</exclude>
                                        <exclude>**/org/sfm/**/time/*</exclude>
                                        <exclude>**/org/sfm/datastax/*</exclude>
                                    </testExcludes>
                                </configuration>
                                <goals>
                                    <goal>testCompile</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>jdk17</id>
            <activation>
                <jdk>1.7</jdk>
            </activation>
            <properties>
                <source.classifier>jdk17-sources</source.classifier>
                <maven.javadoc.skip>true</maven.javadoc.skip>
                <jar.classifier>jdk17</jar.classifier>
            </properties>

            <modules>
                <module>sfm-sql2o</module>
            </modules>
            <build>
                <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>com.google.code.maven-replacer-plugin</groupId>
                        <artifactId>replacer</artifactId>
                        <version>1.5.2</version>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>replace</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <includes>
                                <include>src/main/java/org/sfm/**/*</include>
                                <include>src/test/java/org/sfm/**/*</include>
                                <include>*/src/main/java/org/sfm/**/*</include>
                                <include>*/src/test/java/org/sfm/**/*</include>
                            </includes>
                            <excludes>
                                <exclude>target/**</exclude>
                            </excludes>
                            <replacements>
                                <replacement>
                                    <token>//IFJAVA8_START</token>
                                    <value>/*IFJAVA8_START</value>
                                </replacement>
                                <replacement>
                                    <token>//IFJAVA8_END</token>
                                    <value>IFJAVA8_END*/</value>
                                </replacement>
                            </replacements>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.3</version>
                        <configuration>
                            <source>1.7</source>
                            <target>1.7</target>

                            <excludes>
                                <exclude>**/org/sfm/**/*Spliterator*</exclude>
                                <exclude>**/org/sfm/**/*Optional*</exclude>
                                <exclude>**/org/sfm/**/time/*</exclude>
                            </excludes>

                        </configuration>

                        <executions>
                            <execution>
                                <id>default-testCompile</id>
                                <phase>test-compile</phase>
                                <configuration>
                                    <testExcludes>
                                        <exclude>**/org/sfm/tuples/jool/**/*</exclude>
                                        <exclude>**/org/sfm/**/*Optional*</exclude>
                                        <exclude>**/org/sfm/**/time/*</exclude>
                                    </testExcludes>
                                </configuration>
                                <goals>
                                    <goal>testCompile</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
                </pluginManagement>
            </build>
        </profile>

        <profile>
            <id>jdk18</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <modules>
                <module>sfm-sql2o</module>
            </modules>
        </profile>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <configuration>
                            <passphrase>${gpg.passphrase}</passphrase>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.4</version>
                        <configuration>
                            <classifier>${source.classifier}</classifier>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.3</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>2.5.4</version>
                        <configuration>
                            <goals>deploy nexus-staging:release</goals>
                            <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.6</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>sonatype-nexus-staging</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>dev</id>
            <activation>
                <property>
                    <name>env.TRAVIS</name>
                    <value>true</value>
                </property>
                <jdk>1.8</jdk>
            </activation>
            <modules>
                <module>sfm-test-osgi</module>
                <module>sfm-test-lombok</module>
            </modules>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>simpleflatmapper-maven-repository</id>
            <url>https://arnaudroger.github.io/SimpleFlatMapper/maven/repository</url>
        </repository>
    </repositories>
    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus snapshot repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Sonatype Nexus release repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>
