<?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>ch.codeblock.qrinvoice</groupId>
    <artifactId>qrinvoice-root</artifactId>
    <packaging>pom</packaging>
    <version>1.1</version>

    <name>QR Invoice Library</name>
    <description>A Java library that simplifies the creation of Swiss QR Invoices</description>
    <url>https://www.qr-invoice.ch</url>
    <organization>
        <name>Codeblock GmbH</name>
        <url>https://www.codeblock.ch</url>
    </organization>
    <inceptionYear>2017</inceptionYear>

    <licenses>
        <license>
            <name>GNU Affero General Public License v3</name>
            <url>http://www.fsf.org/licensing/licenses/agpl-3.0.html</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Claude Gex</name>
            <organization>Codeblock GmbH</organization>
            <organizationUrl>https://www.codeblock.ch</organizationUrl>
        </developer>
        <developer>
            <name>Laurent Grangier</name>
            <organization>Codeblock GmbH</organization>
            <organizationUrl>https://www.codeblock.ch</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://bitbucket.org/codeblockgmbh/qrinvoice-java.git</connection>
        <developerConnection>scm:git:ssh://bitbucket.org/codeblockgmbh/qrinvoice-java.git</developerConnection>
        <url>https://bitbucket.org/codeblockgmbh/qrinvoice-java/src</url>
    </scm>

    <modules>
        <module>qrinvoice-license</module>
        <module>qrinvoice-core</module>
        <module>qrinvoice-itext5</module>
        <module>qrinvoice-openpdf</module>
        <module>qrinvoice-tests</module>
        <module>qrinvoice-rest</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- main dependencies -->
        <slf4j.version>1.7.25</slf4j.version>
        <version.itext5>5.5.13</version.itext5>
        <zxing.version>3.3.3</zxing.version>

        <!-- test dependencies -->
        <junit.version>4.12</junit.version>
        <commons-io.version>2.6</commons-io.version>

        <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
        <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
        <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
        <sonatype-maven-gpg-plugin.version>1.6</sonatype-maven-gpg-plugin.version>
        <mojo-maven-license-plugin.version>1.16</mojo-maven-license-plugin.version>
        <maven-wagon-ftp.version>3.1.0</maven-wagon-ftp.version>
        <maven-project-info-reports-plugin.version>3.0.0</maven-project-info-reports-plugin.version>
        <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
        <maven-deploy-plugin.version>2.4</maven-deploy-plugin.version>
        <maven-install-plugin.version>2.2</maven-install-plugin.version>
        <maven-site-plugin.version>3.7.1</maven-site-plugin.version>
        <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
        <maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
        <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${sonatype-maven-gpg-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.5</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--<plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>-->
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${exec-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${mojo-maven-license-plugin.version}</version>
                    <configuration>
                        <projectName>QR Invoice Solutions</projectName>
                        <licenseName>qrinvoice</licenseName>
                        <licenseResolver>classpath://license</licenseResolver>
                        <failOnMissingHeader>true</failOnMissingHeader>
                        <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
                        <canUpdateCopyright>true</canUpdateCopyright>
                        <canUpdateDescription>true</canUpdateDescription>
                        <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                        <excludes>
                            <exclude>**/*.xml</exclude>
                            <exclude>**/*.js</exclude>
                            <exclude>**/*.txt</exclude>
                            <exclude>**/*.properties</exclude>
                            <exclude>**/package-info.java</exclude>
                        </excludes>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>ch.codeblock.qrinvoice</groupId>
                            <artifactId>qrinvoice-license</artifactId>
                            <version>${project.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>first</id>
                            <goals>
                                <!--<goal>remove-file-header</goal>-->
                                <goal>update-file-header</goal>
                            </goals>
                            <phase>process-sources</phase>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ftp</artifactId>
                <version>${maven-wagon-ftp.version}</version>
            </extension>
        </extensions>
    </build>

    <dependencyManagement>
        <dependencies>
            <!-- qr-invoice modules -->
            <dependency>
                <groupId>ch.codeblock.qrinvoice.core</groupId>
                <artifactId>qrinvoice-core</artifactId>
                <version>${project.version}</version>
                <type>jar</type>
            </dependency>
            <dependency>
                <groupId>ch.codeblock.qrinvoice.core</groupId>
                <artifactId>qrinvoice-core</artifactId>
                <version>${project.version}</version>
                <type>test-jar</type>
            </dependency>
            <dependency>
                <groupId>ch.codeblock.qrinvoice.openpdf</groupId>
                <artifactId>qrinvoice-openpdf</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.codeblock.qrinvoice.itext5</groupId>
                <artifactId>qrinvoice-itext5</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- 3rd party -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.zxing</groupId>
                <artifactId>core</artifactId>
                <version>${zxing.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.zxing</groupId>
                <artifactId>javase</artifactId>
                <version>${zxing.version}</version>
            </dependency>

            <!-- 3rd party for testing -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${maven-project-info-reports-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <show>private</show>
                    <failOnError>false</failOnError>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <site>
            <id>qr-invoice-site</id>
            <url>ftp://ftp.qr-invoice.ch/site/${project.version}</url>
        </site>
        <!--
        <repository>
            <id>qr-invoice-mvnrepo</id>
            <url>ftp://ftp.qr-invoice.ch/maven2</url>
        </repository>
        -->
    </distributionManagement>

    <profiles>
        <profile>
            <id>deployment</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- needed for maven central -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${sonatype-maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>