<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" 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.foursoft.jaxb2</groupId>
    <artifactId>jaxb-parent</artifactId>
    <version>0.0.9</version>
    <packaging>pom</packaging>
    <name>jaxb-parent-pom</name>
    <description>Parent POM of all 4Soft JAXB / XML Modules</description>
    <url>https://github.com/4Soft-de/jaxb-parent-pom</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <maven.compiler.release>8</maven.compiler.release>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>

        <!-- Dependencies -->
        <slf4j.version>1.7.32</slf4j.version>
        <junit.jupiter.version>5.7.2</junit.jupiter.version>
        <jaxb2-basics.version>0.12.0</jaxb2-basics.version>
        <assertj-core.version>3.20.2</assertj-core.version>
        <logback-classic.version>1.2.5</logback-classic.version>
        <jaxb-api.version>2.3.1</jaxb-api.version>
        <jaxb-core.version>2.3.0.1</jaxb-core.version>
        <jaxb.version>2.3.3</jaxb.version>
        <javax.annotation.version>1.3.2</javax.annotation.version>
        <maven-core.version>3.8.1</maven-core.version>

        <!-- Plugins -->
        <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
        <maven-jaxb2-plugin.version>0.14.0</maven-jaxb2-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <license-maven-plugin.version>2.0.0</license-maven-plugin.version>
        <maven-javadoc-plugin.version>3.3.0</maven-javadoc-plugin.version>
        <gitflow-maven-plugin.version>1.16.0</gitflow-maven-plugin.version>
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <assertj-assertions-generator-maven-plugin>2.2.0</assertj-assertions-generator-maven-plugin>
        <jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>


        <!-- Release Plugins -->
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>

        <!-- build and release properties -->
        <sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
        <sonar.organization>4soft-de</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>

        <!-- a work around for https://youtrack.jetbrains.com/issue/IDEA-204155 -->
        <test.args>-Xms6g -Denable.write.protection=true -Ddebug.enabled=false -Dfile.encoding=UTF-8 -Djdk.attach.allowAttachSelf</test.args>
        <test.argLine>@{jacocoArgLine} ${test.args}</test.argLine>
        <jacocoArgLine></jacocoArgLine>
        <skipTests>false</skipTests>
        <skipITs>${skipTests}</skipITs>
        <skipUTs>${skipTests}</skipUTs>

    </properties>

    <inceptionYear>2020</inceptionYear>

    <organization>
        <name>4Soft GmbH</name>
        <url>https://www.4soft.de</url>
    </organization>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/4Soft-de/jaxb-parent-pom.git</connection>
        <developerConnection>scm:git:https://github.com/4Soft-de/jaxb-parent-pom.git</developerConnection>
        <url>https://github.com/4Soft-de/jaxb-parent-pom/tree/main</url>
    </scm>

    <developers>
        <developer>
            <name>Rainer Ganß</name>
            <email>ganss@4soft.de</email>
            <organization>4Soft GmbH</organization>
            <organizationUrl>https://www.4soft.de</organizationUrl>
        </developer>
        <developer>
            <name>Johannes Becker</name>
            <email>becker@4soft.de</email>
            <organization>4Soft GmbH</organization>
            <organizationUrl>https://www.4soft.de</organizationUrl>
        </developer>
    </developers>

    <dependencyManagement>
        <dependencies>

            <!--general-->

            <!-- JAXB -->
            <dependency>
                <groupId>org.jvnet.jaxb2_commons</groupId>
                <artifactId>jaxb2-basics</artifactId>
                <version>${jaxb2_commons.version}</version>
            </dependency>

            <dependency>
                <groupId>javax.xml.bind</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>${jaxb-api.version}</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-core</artifactId>
                <scope>provided</scope>
                <version>${jaxb-core.version}</version>
            </dependency>

            <!-- JAXB-->
            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-impl</artifactId>
                <scope>provided</scope>
                <version>${jaxb.version}</version>
            </dependency>
            <!-- JAXB-->
            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-xjc</artifactId>
                <scope>provided</scope>
                <version>${jaxb.version}</version>
            </dependency>

            <!--VEC KBL-->
            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>${javax.annotation.version}</version>
            </dependency>

            <!--logging-->

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <!--test-->

            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback-classic.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj-core.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin-testing</artifactId>
                <version>${maven-jaxb2-plugin.version}</version>
                <scope>test</scope>
            </dependency>
            <!--VEC KBL-->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jul-to-slf4j</artifactId>
                <version>${slf4j.version}</version>
                <scope>test</scope>
            </dependency>
            <!--JAXB-->
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-core</artifactId>
                <version>${maven-core.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <defaultGoal>install</defaultGoal>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.amashchenko.maven.plugin</groupId>
                    <artifactId>gitflow-maven-plugin</artifactId>
                    <version>${gitflow-maven-plugin.version}</version>
                    <configuration>
                        <argLine>-DskipTests -P release -s .mvn/release.settings.xml</argLine>
                        <installProject>true</installProject>
                        <skipTestProject>true</skipTestProject>
                        <postReleaseGoals>deploy</postReleaseGoals>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <configuration>
                        <doclint>none</doclint>
                        <verbose>false</verbose>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                    <configuration>
                        <archive>
                            <addMavenDescriptor>false</addMavenDescriptor>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${license-maven-plugin.version}</version>
                    <configuration>
                        <verbose>false</verbose>
                        <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                        <processStartTag>========================LICENSE_START=================================
                        </processStartTag>
                        <processEndTag>=========================LICENSE_END==================================
                        </processEndTag>
                    </configuration>
                    <executions>
                        <execution>
                            <id>first</id>
                            <goals>
                                <goal>update-file-header</goal>
                            </goals>
                            <phase>process-sources</phase>
                            <configuration>
                                <licenseName>mit</licenseName>
                                <roots>
                                    <root>src/main/java</root>
                                    <root>src/test/java</root>
                                    <root>${project.build.directory}/generated-sources/assertj-assertions</root>
                                </roots>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-maven-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-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                            <configuration>
                                <gpgArguments>
                                    <arg>--pinentry-mode</arg>
                                    <arg>loopback</arg>
                                </gpgArguments>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.assertj</groupId>
                    <artifactId>assertj-assertions-generator-maven-plugin</artifactId>
                    <version>${assertj-assertions-generator-maven-plugin}</version>
                    <configuration>
                        <quiet>true</quiet>
                        <cleanTargetDir>true</cleanTargetDir>
                        <generateAssertions>true</generateAssertions>
                        <generateBddAssertions>false</generateBddAssertions>
                        <generateSoftAssertions>true</generateSoftAssertions>
                        <generatedSourcesScope>compile</generatedSourcesScope>
                        <targetDir>${project.build.directory}/generated-sources/assertj-assertions</targetDir>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <trimStackTrace>false</trimStackTrace>
                        <argLine>${test.argLine}</argLine>
                        <skipTests>${skipUTs}</skipTests>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                    <executions>
                        <!-- set arg line property for surefire -->
                        <execution>
                            <id>before-unit-test-execution</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <propertyName>jacocoArgLine</propertyName>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>
</project>
