<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>de.trustable.cmp.client</groupId>
    <artifactId>cmpClient</artifactId>
    <version>3.2.0</version>
    <packaging>jar</packaging>

    <name>cmpClient</name>
    <description>Simple command line client and API to request / revoke a certificate using the CMP protocol, based on
        Bouncy Castle
    </description>

    <url>https://github.com/kuehne-trustable-de/cmpClient</url>

    <licenses>
        <license>
            <name>European Union Public Licence (EUPL-1.2)</name>
            <url>https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Andreas Kuehne</name>
            <email>kuehne@trustable.de</email>
            <organization>trustable solutions UG</organization>
            <organizationUrl>https://trustable.de</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>https://github.com/kuehne-trustable-de/cmpClient.git</connection>
        <developerConnection>https://github.com/kuehne-trustable-de/cmpClient.git</developerConnection>
        <url>https://github.com/kuehne-trustable-de/cmpClient.git</url>
    </scm>

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

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>

        <bouncyCastleVersion>1.78.1</bouncyCastleVersion>
        <slf4jSimpleVersion>2.0.12</slf4jSimpleVersion>
        <dependencyCheck.version>9.0.9</dependencyCheck.version>
        <dependencyCheck.skip>true</dependencyCheck.skip>

    </properties>

    <dependencies>

        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk18on</artifactId>
            <version>${bouncyCastleVersion}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4jSimpleVersion}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>RELEASE</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>trustable.eu</id>
            <url>https://trustable.eu/artifactory/ca3s</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.cyclonedx</groupId>
                <artifactId>cyclonedx-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>makeAggregateBom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>de.trustable.cmp.client.cmpClient.CMPCmdLineClient</mainClass>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>dependency-jars/</classpathPrefix>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.6.1</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>
                                ${project.build.directory}/dependency-jars/
                            </outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.6.0</version>

                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>de.trustable.cmp.client.cmpClient.CMPCmdLineClient</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>

                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>

            </plugin>
            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>${dependencyCheck.version}</version>
                <configuration>
                    <cveValidForHours>12</cveValidForHours>
                    <failBuildOnCVSS>4</failBuildOnCVSS>
                    <outputDirectory>${project.build.directory}/dependency-check</outputDirectory>
                    <format>HTML</format>
                    <skip>${dependencyCheck.skip}</skip>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <detectJavaApiLink>false</detectJavaApiLink>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <configuration>
                            <keyname>${gpg.keyname}</keyname>
                            <passphraseServerId>${gpg.keyname}</passphraseServerId>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
