<?xml version="1.0"?>
<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>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
        <relativePath />
    </parent>

    <groupId>org.exist-db</groupId>
    <artifactId>exist-apps-parent</artifactId>
    <version>1.12.0</version>
    <packaging>pom</packaging>

    <name>eXist-db Apps parent POM</name>
    <description>Maven parent POM for eXist Apps</description>
    <url>https://www.github.com/exist-db/exist-apps-parent</url>
    <inceptionYear>2017</inceptionYear>

    <organization>
        <name>eXist-db</name>
        <url>http://exist-db.org</url>
    </organization>

    <licenses>
        <license>
            <name>GNU Lesser General Public License, version 2.1</name>
            <url>http://opensource.org/licenses/LGPL-2.1</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://www.github.com/exist-db/exist-apps-parent.git</url>
        <connection>scm:git:https://www.github.com/exist-db/exist-apps-parent.git</connection>
        <developerConnection>scm:git:https://www.github.com/exist-db/exist-apps-parent.git</developerConnection>
      <tag>1.12.0</tag>
  </scm>
    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/eXist-db/exist-apps-parent/issues</url>
    </issueManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.source>1.8</project.build.source>
        <project.build.target>1.8</project.build.target>

        <package-title>${project.name}</package-title>
        <package-abbrev>${project.artifactId}</package-abbrev>
        <package-final-name>${project.artifactId}-${project.version}</package-final-name>

        <!-- other packages that the documentation (of apps) links to; their `abbrev` must match their expath-pkg.xml -->
        <documentation.pkg.abbrev>exist-documentation</documentation.pkg.abbrev>
        <dashboard.pkg.abbrev>dashboard</dashboard.pkg.abbrev>
        <demo.pkg.abbrev>demo</demo.pkg.abbrev>
        <fundocs.pkg.abbrev>fundocs</fundocs.pkg.abbrev>
        <exide.pkg.abbrev>eXide</exide.pkg.abbrev>
        <monex.pkg.abbrev>monex</monex.pkg.abbrev>
        <atomicwiki.pkg.abbrev>atomic-wiki</atomicwiki.pkg.abbrev>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.2</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>4.1</version>
                </plugin>
                <plugin>
                    <groupId>com.code54.mojo</groupId>
                    <artifactId>buildversion-plugin</artifactId>
                    <version>1.0.3</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>xml-maven-plugin</artifactId>
                    <version>1.0.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.10.0</version>
                    <configuration>
                        <source>${project.build.source}</source>
                        <target>${project.build.target}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>ro.kuberam.maven.plugins</groupId>
                    <artifactId>kuberam-expath-plugin</artifactId>
                    <version>0.6.3</version>
                    <executions>
                        <execution>
                            <id>create-xar</id>
                            <phase>package</phase>
                            <goals>
                                <goal>make-xar</goal>
                            </goals>
                            <configuration>
                                <descriptor>xar-assembly.xml</descriptor>
                                <finalName>${package-final-name}</finalName>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.2</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Build-Tag>${build-tag}</Build-Tag>
                                <Git-Commit>${build-commit}</Git-Commit>
                                <Git-Commit-Abbrev>${build-commit-abbrev}</Git-Commit-Abbrev>
                                <Build-Version>${build-version}</Build-Version>
                                <Build-Timestamp>${build-tstamp}</Build-Timestamp>
                                <Source-Repository>${project.scm.connection}</Source-Repository>
                                <Description>${project.description}</Description>
                                <Implementation-URL>${project.url}</Implementation-URL>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <!-- Attach source jars -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Build-Tag>${build-tag}</Build-Tag>
                                <Git-Commit>${build-commit}</Git-Commit>
                                <Git-Commit-Abbrev>${build-commit-abbrev}</Git-Commit-Abbrev>
                                <Build-Version>${build-version}</Build-Version>
                                <Build-Timestamp>${build-tstamp}</Build-Timestamp>
                                <Source-Repository>${project.scm.connection}</Source-Repository>
                                <Description>${project.description}</Description>
                                <Implementation-URL>${project.url}</Implementation-URL>
                            </manifestEntries>
                        </archive>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Attach javadoc jars -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.3.2</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <source>${project.build.source}</source>
                        <archive>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Build-Tag>${build-tag}</Build-Tag>
                                <Git-Commit>${build-commit}</Git-Commit>
                                <Git-Commit-Abbrev>${build-commit-abbrev}</Git-Commit-Abbrev>
                                <Build-Version>${build-version}</Build-Version>
                                <Build-Timestamp>${build-tstamp}</Build-Timestamp>
                                <Source-Repository>${project.scm.connection}</Source-Repository>
                                <Description>${project.description}</Description>
                                <Implementation-URL>${project.url}</Implementation-URL>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-changes-plugin</artifactId>
                    <version>2.12.1</version>
                    <configuration>
                        <includeOpenIssues>false</includeOpenIssues>
                        <onlyMilestoneIssues>false</onlyMilestoneIssues>
                        <columnNames>Type, Summary</columnNames>
                        <outputDirectory>${project.basedir}</outputDirectory>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <failIfMissing>true</failIfMissing>
                    <aggregate>true</aggregate>
                    <strictCheck>true</strictCheck>
                    <licenseSets>
                        <licenseSet>
                            <header>com/mycila/maven/plugin/license/templates/LGPL-21.txt</header>
                            <properties>
                                <owner>${project.organization.name}</owner>
                                <organisation>${project.organization.name}</organisation>
                                <email>exit-open@lists.sourceforge.net</email>
                                <url>${project.organization.url}</url>
                            </properties>
                            <excludes>
                                <exclude>pom.xml</exclude>
                                <exclude>README.md</exclude>
                                <exclude>LICENSE</exclude>
                                <exclude>xquery-license-style.xml</exclude>
                                <exclude>xar-assembly.xml</exclude>
                                <exclude>**/*.ent</exclude>
                            </excludes>
                        </licenseSet>
                    </licenseSets>
                    <headerDefinitions>
                        <headerDefinition>xquery-license-style.xml</headerDefinition>
                    </headerDefinitions>
                    <mapping>
                        <xq>xquery_style</xq>
                        <xqm>xquery_style</xqm>
                        <xql>xquery_style</xql>
                        <xconf>xml_style</xconf>
                    </mapping>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.code54.mojo</groupId>
                <artifactId>buildversion-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>set-properties</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <configuration>
                    <useAgent>true</useAgent>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <mavenExecutorId>forked-path</mavenExecutorId> <!-- avoid a bug with GPG plugin hanging http://jira.codehaus.org/browse/MGPG-9 -->
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
        </plugins>

    </build>

    <repositories>
        <repository>
            <id>exist-db</id>
            <url>https://repo.evolvedbinary.com/repository/exist-db/</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>clojars.org</id>
            <url>https://clojars.org/repo</url>
        </pluginRepository>
    </pluginRepositories>

</project>
