<!--

    Copyright © 2013-2021 Mycila (mathieu.carbou@gmail.com)

    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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mycila</groupId>
    <artifactId>mycila-pom</artifactId>
    <version>12</version>
    <packaging>pom</packaging>

    <name>Mycila POM</name>
    <description>Parent POM</description>
    <inceptionYear>2013</inceptionYear>
    <url>http://mycila.github.io/${mycila.github.name}</url>

    <properties>
        <jdk.version>1.8</jdk.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <osgi.private>com.mycila.${mycila.github.name}.internal</osgi.private>
        <osgi.import>*</osgi.import>
        <osgi.export>!com.mycila.${mycila.github.name}.internal*,com.mycila.${mycila.github.name}*;version="${project.version}";-noimport:=true</osgi.export>
        <mycila.github.name>pom</mycila.github.name>
    </properties>

    <scm>
        <connection>scm:git:https://github.com/mycila/${mycila.github.name}.git</connection>
        <developerConnection>scm:git:git@github.com:mycila/${mycila.github.name}.git</developerConnection>
        <url>http://github.com/mycila/${mycila.github.name}</url>
        <tag>mycila-pom-12</tag>
    </scm>

    <organization>
        <name>Mycila</name>
        <url>https://mycila.mathieu.photography/</url>
    </organization>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/mycila/${mycila.github.name}/issues</url>
    </issueManagement>

    <ciManagement>
        <system>GitHub</system>
        <url>https://github.com/mycila/${mycila.github.name}/actions</url>
    </ciManagement>

    <developers>
        <developer>
            <id>mathieucarbou</id>
            <name>Mycila</name>
            <email>mathieu.carbou@gmail.com</email>
            <url>https://github.com/mathieucarbou</url>
            <organization>Mycila</organization>
            <organizationUrl>https://mycila.mathieu.photography/</organizationUrl>
            <roles>
                <role>leader</role>
                <role>architect</role>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <distributionManagement>
        <repository>
            <id>mycila-oss-staging</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>mycila-oss-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <uniqueVersion>false</uniqueVersion>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.4.0</version>
                    <configuration>
                        <rules>
                            <requireMavenVersion>
                                <version>(3.2.5,)</version>
                                <message>Require maven 3.2.5 or better.</message>
                            </requireMavenVersion>
                        </rules>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.11.0</version>
                    <configuration>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.1.0</version>
                    <configuration>
                        <useAgent>false</useAgent>
                        <keyname>${gpg.keyname}</keyname>
                        <passphrase>${gpg.passphrase}</passphrase>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.1</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jarsigner-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.3.1</version>
                    <configuration>
                        <filesets>
                            <fileset>
                                <directory>${project.basedir}</directory>
                                <includes>
                                    <include>dependency-reduced-pom.xml</include>
                                    <include>dependency-reduced-pom-*.xml</include>
                                </includes>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>4.2</version>
                    <configuration>
                        <licenseSets>
                            <licenseSet>
                              <header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
                              <properties>
                                  <year>${project.inceptionYear}-2021</year>
                                  <email>mathieu.carbou@gmail.com</email>
                              </properties>
                              <excludes>
                                  <exclude>src/test/resources/**</exclude>
                              </excludes>
                            </licenseSet>
                          </licenseSets>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.5.0</version>
                    <configuration>
                        <source>${jdk.version}</source>
                        <encoding>UTF-8</encoding>
                        <maxmemory>1g</maxmemory>
                        <links>
                            <link>https://docs.oracle.com/javase/8/docs/api/</link>
                        </links>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.bluetrainsoftware.maven</groupId>
                    <artifactId>groovydoc-maven-plugin</artifactId>
                    <version>2.1</version>
                    <executions>
                        <execution>
                            <id>attach-docs</id>
                            <goals>
                                <goal>attach-docs</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>5.1.9</version>
                    <extensions>true</extensions>
                    <executions>
                        <execution>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>manifest</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <instructions>
                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
                            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                            <Bundle-Name>${project.name}</Bundle-Name>
                            <Bundle-Description>${project.description}</Bundle-Description>
                            <Bundle-Version>${project.version}</Bundle-Version>
                            <Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
                            <Bundle-DocURL>${project.url}</Bundle-DocURL>
                            <Bundle-Copyright>Copyright (C) ${project.inceptionYear} ${project.organization.name}</Bundle-Copyright>
                            <Private-Package>${osgi.private}</Private-Package>
                            <Export-Package>${osgi.export}</Export-Package>
                            <Import-Package>${osgi.import}</Import-Package>
                            <_versionpolicy>[${version;===;${@}},${version;+;${@}})</_versionpolicy>
                            <_removeheaders>
                                Built-By,Tool,Created-By,
                                Include-Resource,Private-Package,
                                Ignore-Package,Bnd-LastModified
                            </_removeheaders>
                        </instructions>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>3.9.0</version>
                    <configuration>
                        <detail>true</detail>
                        <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                    </configuration>
                    <executions>
                        <execution>
                            <id>generate-helpmojo</id>
                            <goals>
                                <goal>helpmojo</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>generate-descriptor</id>
                            <goals>
                                <goal>descriptor</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-report-plugin</artifactId>
                <version>3.9.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.4.5</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.bluetrainsoftware.maven</groupId>
                        <artifactId>groovydoc-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-docs</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>attach-docs</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
