<?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>com.lympid</groupId>
    <artifactId>lympid-parent</artifactId>
    <version>0.9.0</version>
    <packaging>pom</packaging>
    
    <name>lympid-parent</name>  
    <description>Parent pom for all Lympid components</description>
    <url>http://github.com/lympid/</url>
    <inceptionYear>2015</inceptionYear>
    <organization>
        <name>Lympid</name>
        <url>http://lympid.com/</url>
    </organization>
    
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>  
    
    <developers>
        <developer>
            <id>fabienrenaud</id>
            <name>Fabien Renaud</name>
            <email />
        </developer>
    </developers>
    <contributors/>
    
    <scm>
        <url>http://github.com/lympid/lympid-parent</url>
        <connection>scm:git:ssh://github.com/lympid/lympid-parent.git</connection>
        <developerConnection>scm:git:git+ssh://git@github.com/lympid/lympid-parent.git</developerConnection>
        <tag>HEAD</tag>
    </scm>
    <issueManagement>
        <system>GitHub Issue Management</system>
        <url>https://github.com/lympid/${project.artifactId}/issues</url>
    </issueManagement>
    
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>

        <repository>
            <id>ossrh</id>
            <name>Nexus Release Repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
        
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    
        <javac.src.version>1.8</javac.src.version>
        <javac.target.version>1.8</javac.target.version>
        
        <!-- With 2.4+, include all debug info for the main executable; need to figure
           out a way to build "non-debug" variants as well
        -->
        <javac.debuglevel>lines,source,vars</javac.debuglevel>
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssZ</maven.build.timestamp.format>
        <!--
         | Configuration properties for the OSGi maven-bundle-plugin
        -->
        <osgi.export>${project.groupId}.*;version=${project.version}</osgi.export>
        <osgi.import>*</osgi.import>
        <osgi.dynamicImport />
        <osgi.private />
        <osgi.requiredExecutionEnvironment />
        <osgi.versionpolicy>${range;[===,=+);${@}}</osgi.versionpolicy>

        <!-- Versions for other dependencies -->
        <version.junit>4.11</version.junit>
        
        <version.plugin.bundle>2.5.3</version.plugin.bundle>
        <version.plugin.jar>2.5</version.plugin.jar>
        <version.plugin.javadoc>2.10.1</version.plugin.javadoc>
        <version.plugin.release>2.5.1</version.plugin.release>
        <version.plugin.replacer>1.5.2</version.plugin.replacer>
        <version.plugin.surefire>2.18.1</version.plugin.surefire>
    
        <javadoc.maxmemory>1g</javadoc.maxmemory>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${version.junit}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.6.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.7</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.4</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>${version.plugin.bundle}</version>
                    <configuration>
                        <instructions>
                            <!--
                             | stops the "uses" clauses being added to "Export-Package" manifest entry
                            -->
                            <_nouses>true</_nouses>
                            <!--
                             | Stop the JAVA_1_n_HOME variables from being treated as headers by Bnd
                            -->
                            <_removeheaders>Include-Resource,JAVA_1_3_HOME,JAVA_1_4_HOME,JAVA_1_5_HOME,JAVA_1_6_HOME,JAVA_1_7_HOME</_removeheaders>
                            <_versionpolicy>${osgi.versionpolicy}</_versionpolicy>
                            <Bundle-Name>${project.name}</Bundle-Name>
                            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                            <Bundle-Description>${project.description}</Bundle-Description>
                            <Export-Package>${osgi.export}</Export-Package>
                            <Private-Package>${osgi.private}</Private-Package>
                            <Import-Package>${osgi.import}</Import-Package>
                            <DynamicImport-Package>${osgi.dynamicImport}</DynamicImport-Package>
                            <Bundle-DocURL>${project.url}</Bundle-DocURL>
                            <Bundle-RequiredExecutionEnvironment>${osgi.requiredExecutionEnvironment}</Bundle-RequiredExecutionEnvironment>

                            <Implementation-Build-Date>${maven.build.timestamp}</Implementation-Build-Date>
                            <X-Compile-Source-JDK>${javac.src.version}</X-Compile-Source-JDK>
                            <X-Compile-Target-JDK>${javac.target.version}</X-Compile-Target-JDK>

                            <Implementation-Title>${project.name}</Implementation-Title>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>

                            <Specification-Title>${project.name}</Specification-Title>
                            <Specification-Version>${project.version}</Specification-Version>
                            <Specification-Vendor>${project.organization.name}</Specification-Vendor>
                        </instructions>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-maven-plugin</artifactId>
                    <version>2.1</version>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.9.1</version>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.3.1</version>
                <executions>
                    <execution>
                        <id>enforce-java</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>[1.8,)</version>
                                    <message>[ERROR] The currently supported version of Java is 1.8 or higher</message>
                                </requireJavaVersion>
                                <requireMavenVersion>
                                    <version>[3.0,)</version>
                                    <message>[ERROR] The currently supported version of Maven is 3.0 or higher</message>
                                </requireMavenVersion>
                                <requirePluginVersions>
                                    <banLatest>true</banLatest>
                                    <banRelease>true</banRelease>
                                    <banSnapshots>true</banSnapshots>
                                    <phases>clean,deploy,site</phases>
                                    <message>[ERROR] Best Practice is to always define plugin versions!</message>
                                </requirePluginVersions>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>${javac.src.version}</source>
                    <target>${javac.target.version}</target>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <optimize>true</optimize>
                    <!-- 16-Apr-2013, tatu: As per Nick W's suggestions, let's
                      use these to reduce jar size
                    -->
                    <debug>true</debug>
                    <debuglevel>${javac.debuglevel}</debuglevel>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.plugin.surefire}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${version.plugin.jar}</version>
            </plugin>
            <plugin>
                <artifactId>maven-site-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-descriptor</id>
                        <goals>
                            <goal>attach-descriptor</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>1.9.1</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.9.1</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>

        <extensions>
            <extension>
                <groupId>org.apache.maven.scm</groupId>
                <artifactId>maven-scm-provider-gitexe</artifactId>
                <version>1.9.1</version>
            </extension>

            <extension>
                <groupId>org.apache.maven.scm</groupId>
                <artifactId>maven-scm-manager-plexus</artifactId>
                <version>1.9.1</version>
            </extension>

        </extensions>
    </build>

    <reporting>
        <plugins>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${version.plugin.javadoc}</version>
                <configuration>
                    <bootclasspath>${sun.boot.class.path}</bootclasspath>
                    <doclet>com.google.doclava.Doclava</doclet>
                    <useStandardDocletOptions>false</useStandardDocletOptions>
                    <additionalJOption>-J-Xmx1024m</additionalJOption>
                    <maxmemory>${javadoc.maxmemory}</maxmemory>
                    <links>
                        <link>http://docs.oracle.com/javase/8/docs/api/</link>
                    </links>
                    <docletArtifact>
                        <groupId>com.google.doclava</groupId>
                        <artifactId>doclava</artifactId>
                        <version>1.0.3</version>
                    </docletArtifact>
                    <additionalparam>
                        -hdf project.name "${project.name}"
                        -d ${project.reporting.outputDirectory}/apidocs
                    </additionalparam>
                </configuration>
                <reportSets>
                    <reportSet>
                        <id>default</id>
                        <reports>
                            <report>javadoc</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.8</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>2.5</version>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jdepend-maven-plugin</artifactId>
                <version>2.0</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>${version.plugin.surefire}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <linkXref>true</linkXref>
                    <minimumTokens>100</minimumTokens>
                    <targetJdk>1.8</targetJdk>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>taglist-maven-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <tagListOptions>
                        <tagClasses>
                            <tagClass>
                                <displayName>Todo Work</displayName>
                                <tags>
                                    <tag>
                                        <matchString>TODO</matchString>
                                        <matchType>ignoreCase</matchType>
                                    </tag>
                                    <tag>
                                        <matchString>FIXME</matchString>
                                        <matchType>ignoreCase</matchType>
                                    </tag>
                                </tags>
                            </tagClass>
                        </tagClasses>
                    </tagListOptions>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <!-- 2.2 has a bug, revert to 2.1.2 -->
                        <version>2.4</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                                <configuration>
                                    <archive>
                                        <manifest>
                                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                        </manifest>
                                        <manifestEntries>
                                            <Implementation-Build-Date>${maven.build.timestamp}</Implementation-Build-Date>
                                            <X-Compile-Source-JDK>${javac.src.version}</X-Compile-Source-JDK>
                                            <X-Compile-Target-JDK>${javac.target.version}</X-Compile-Target-JDK>
                                        </manifestEntries>
                                    </archive>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${version.plugin.javadoc}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <quiet>true</quiet>
                                    <archive>
                                        <manifest>
                                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                        </manifest>
                                        <manifestEntries>
                                            <Implementation-Build-Date>${maven.build.timestamp}</Implementation-Build-Date>
                                            <X-Compile-Source-JDK>${javac.src.version}</X-Compile-Source-JDK>
                                            <X-Compile-Target-JDK>${javac.target.version}</X-Compile-Target-JDK>
                                        </manifestEntries>
                                    </archive>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    
</project>
