<?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>

    <parent>
        <groupId>org.basepom</groupId>
        <artifactId>basepom-oss</artifactId>
        <version>61</version>
    </parent>

    <groupId>io.github.spannm</groupId>
    <artifactId>jackcess</artifactId>
    <version>5.1.0</version>
    <packaging>jar</packaging>

    <name>Jackcess</name>
    <description>A pure Java library for reading from and writing to MS Access databases</description>
    <url>${githubBaseUrl}${project.artifactId}</url>
    <inceptionYear>2005</inceptionYear>

    <organization>
        <name>Jackcess</name>
        <url>${project.url}</url>
    </organization>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>${developerId}</id>
            <name>Markus Spann</name>
            <email>spannm@outlook.de</email>
            <organizationUrl>${githubBaseUrl}</organizationUrl>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <contributors>
        <contributor>
            <name>Tim McCune</name>
            <email>javajedi@users.sf.net</email>
            <roles>
                <role>Original author and project founder</role>
                <role>developer emeritus</role>
            </roles>
        </contributor>
        <contributor>
            <name>James Ahlborn</name>
            <email>jahlborn@users.sf.net</email>
            <roles>
                <role>developer emeritus</role>
            </roles>
        </contributor>
    </contributors>

    <scm>
        <connection>scm:git:ssh//git@github.com/${developerId}/${project.artifactId}.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/${developerId}/${project.artifactId}.git</developerConnection>
        <url>https://github.com/${developerId}/${project.artifactId}/tree/master</url>
      <tag>jackcess-5.1.0</tag>
  </scm>

    <issueManagement>
        <system>Github</system>
        <url>${project.url}/issues</url>
    </issueManagement>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Nexus Release Repository</name>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <site>
            <id>local</id>
            <name>Local Maven site</name>
            <url>file://${java.io.tmpdir}/${project.artifactId}/site-prepared</url>
        </site>
    </distributionManagement>

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

        <project.build.systemJdk>11</project.build.systemJdk>
        <project.build.targetJdk>11</project.build.targetJdk>

        <developerId>spannm</developerId>
        <githubBaseUrl>https://github.com/${developerId}/</githubBaseUrl>

        <dep.poi.version>4.1.2</dep.poi.version>

        <dep.slf4j.version>2.0.16</dep.slf4j.version>

        <dep.junit.version>5.11.4</dep.junit.version>

        <!-- override basepom versions -->
        <dep.checkstyle.version>10.21.2</dep.checkstyle.version>
        <dep.pmd.version>7.10.0</dep.pmd.version>
        <dep.spotbugs.version>4.9.1</dep.spotbugs.version>

        <!-- downgrade site plugin to work with site skin -->
        <dep.plugin.site.version>3.21.0</dep.plugin.site.version>
        <dep.plugin.maven-fluido-skin.version>2.0.1</dep.plugin.maven-fluido-skin.version>

        <!-- additional plugins not defined in parent -->
        <dep.plugin.sortpom.version>4.0.0</dep.plugin.sortpom.version>
        <dep.plugin.sonar.version>3.10.0.2594</dep.plugin.sonar.version>

        <basepom.check.skip-checkstyle>false</basepom.check.skip-checkstyle>
        <basepom.check.skip-pmd>false</basepom.check.skip-pmd>
        <basepom.check.skip-spotbugs>true</basepom.check.skip-spotbugs>
        <basepom.check.skip-license>true</basepom.check.skip-license>

        <basepom.javadoc.skip>false</basepom.javadoc.skip>
        <basepom.javadoc.show>protected</basepom.javadoc.show>

        <basepom.site.skip-deploy>false</basepom.site.skip-deploy>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${dep.junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>${dep.poi.version}</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk-platform-logging</artifactId>
            <version>${dep.slf4j.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${dep.slf4j.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-launcher</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-engine</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-commons</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>

        <defaultGoal>clean verify</defaultGoal>

        <pluginManagement>

            <plugins>

                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <compilerArgument>-Xlint:all</compilerArgument>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <systemPropertyVariables combine.children="append">
                            <user.timezone />
                        </systemPropertyVariables>
                        <forkCount>1</forkCount>
                        <reuseForks>true</reuseForks>
                        <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
                        <argLine>@{basepom.coverage.test-args} -Xmx1024m -Dfile.encoding=UTF-8</argLine>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <configuration>
                        <configLocation>src/test/resources/team/checkstyle-rules.xml</configLocation>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <configuration>
                        <rulesets>
                            <ruleset>src/test/resources/team/pmd-rules.xml</ruleset>
                        </rulesets>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>com.github.ekryd.sortpom</groupId>
                    <artifactId>sortpom-maven-plugin</artifactId>
                    <version>${dep.plugin.sortpom.version}</version>
                    <configuration>
                        <createBackupFile>false</createBackupFile>
                        <expandEmptyElements>false</expandEmptyElements>
                        <nrOfIndentSpace>4</nrOfIndentSpace>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${dep.plugin.javadoc.version}</version>
                    <configuration>
                        <useStandardDocletOptions>true</useStandardDocletOptions>
                        <nocomment>false</nocomment>
                        <detectJavaApiLink>false</detectJavaApiLink>
                        <detectLinks>false</detectLinks>
                        <doclint>all,-missing</doclint>
                        <!-- add all modules of module-path so javadoc generation will
                             not fail on modularized projects (includes use of automatic module names) -->
                        <additionalOptions>
                            <option>--add-modules</option>
                            <option>ALL-MODULE-PATH</option>
                            <option>-Xmaxwarns 500</option>
                        </additionalOptions>
                    </configuration>
                </plugin>

            </plugins>

        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <addMavenDescriptor>true</addMavenDescriptor>
                        <compress>true</compress>
                        <index>false</index>
                        <manifest>
                            <addClasspath>false</addClasspath>
                            <addDefaultEntries>true</addDefaultEntries>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>false</addDefaultSpecificationEntries>
                            <addBuildEnvironmentEntries>true</addBuildEnvironmentEntries>
                        </manifest>
                        <manifestEntries>
                            <Build-Time>${maven.build.timestamp}</Build-Time>
                            <Maven-Version>${maven.version}</Maven-Version>
                            <Creation-Java-Vendor>${java.vendor}</Creation-Java-Vendor>
                            <Creation-Java-Version>${java.version}</Creation-Java-Version>
                            <Creation-Java-Runtime-Name>${java.runtime.name}</Creation-Java-Runtime-Name>
                            <Creation-Java-Runtime-Version>${java.runtime.version}</Creation-Java-Runtime-Version>
                            <Creation-Os-Name>${os.name}</Creation-Os-Name>
                            <Creation-Os-Arch>${os.arch}</Creation-Os-Arch>
                            <Creation-Os-Version>${os.version}</Creation-Os-Version>
                            <Creation-User>${user.name}</Creation-User>
                            <Creation-Timezone>${user.timezone}</Creation-Timezone>
                            <Creation-Time>${maven.build.timestamp}</Creation-Time>
                            <Project-Name>${project.name}</Project-Name>
                            <Project-Description>${project.description}</Project-Description>
                            <Project-Url>${project.url}</Project-Url>
                            <Project-Inception-Year>${project.inceptionYear}</Project-Inception-Year>
                            <Organization-Name>${project.organization.name}</Organization-Name>
                            <Organization-Url>${project.organization.url}</Organization-Url>
                            <Automatic-Module-Name>io.github.spannm.jackcess</Automatic-Module-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

        </plugins>

    </build>

    <profiles>

        <profile>
            <id>fast</id>
            <!-- Profile to skip time-consuming steps. -->
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <!-- skip _compiling_ the tests -->
                <maven.test.skip>true</maven.test.skip>
                <!-- skip execution of tests -->
                <skipTests>true</skipTests>

                <maven.javadoc.skip>true</maven.javadoc.skip>
                <basepom.check.skip-extended>true</basepom.check.skip-extended>
            </properties>
        </profile>

        <profile>
            <id>github-deploy-snapshot-package</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>github</id>
                    <name>${developerId} github packages</name>
                    <url>https://maven.pkg.github.com/${developerId}/${project.artifactId}</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>

        <profile>
            <!-- mvn verify -P sonarcloud -->
            <id>sonarcloud</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <sonar.skip>false</sonar.skip>
                <sonar.host.url>https://sonarcloud.io</sonar.host.url>
                <sonar.organization>spannm</sonar.organization>
                <!-- sonar.token>YOUR_TOKEN_HERE</sonar.token -->

                <basepom.test.skip>true</basepom.test.skip>
                <basepom.check.skip-all>true</basepom.check.skip-all>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonarsource.scanner.maven</groupId>
                        <artifactId>sonar-maven-plugin</artifactId>
                        <version>${dep.plugin.sonar.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sonar</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <useReleaseProfile>false</useReleaseProfile>
                            <releaseProfiles>release</releaseProfiles>
                            <goals>deploy</goals>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <doclint>none</doclint>
                        </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>
                        <configuration>
                            <executable>gpg</executable>
                            <!--passphrase>${gpg.passphrase}</passphrase-->
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>

    </profiles>

</project>
