<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2020 Rob Spoor

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<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>com.github.robtimus</groupId>
  <artifactId>obfuscation-core</artifactId>
  <version>1.0</version>
  <packaging>jar</packaging>

  <name>obfuscation-core</name>
  <description>Provides functionality for obfuscating text</description>
  <url>https://robtimus.github.io/obfuscation-core/</url>
  <inceptionYear>2020</inceptionYear>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Rob Spoor</name>
      <email>robtimus@users.noreply.github.com</email>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:robtimus/obfuscation-core.git</connection>
    <developerConnection>scm:git:git@github.com:robtimus/obfuscation-core.git</developerConnection>
    <tag>1.0</tag>
    <url>https://github.com/robtimus/obfuscation-core</url>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/robtimus/obfuscation-core/issues</url>
  </issueManagement>

  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <version.java>1.8</version.java>

    <version.hamcrest>2.2</version.hamcrest>
    <version.junit>5.6.2</version.junit>
    <version.mockito>3.3.3</version.mockito>

    <version.plugin.antrun>1.8</version.plugin.antrun>
    <version.plugin.assembly>3.1.1</version.plugin.assembly>
    <version.plugin.clean>3.1.0</version.plugin.clean>
    <version.plugin.compiler>3.8.1</version.plugin.compiler>
    <version.plugin.dependency>3.1.1</version.plugin.dependency>
    <version.plugin.deploy>2.8.2</version.plugin.deploy>
    <version.plugin.gpg>1.6</version.plugin.gpg>
    <version.plugin.nexus-staging>1.6.8</version.plugin.nexus-staging>
    <version.plugin.i18n>1.0</version.plugin.i18n>
    <version.plugin.info-reports>3.0.0</version.plugin.info-reports>
    <version.plugin.install>2.5.2</version.plugin.install>
    <version.plugin.jar>3.1.1</version.plugin.jar>
    <version.plugin.javadoc>3.1.0</version.plugin.javadoc>
    <version.plugin.release>2.5.3</version.plugin.release>
    <version.plugin.resources>3.1.0</version.plugin.resources>
    <version.plugin.site>3.7.1</version.plugin.site>
    <version.plugin.source>3.1.0</version.plugin.source>
    <version.plugin.surefire>2.22.2</version.plugin.surefire>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${version.junit}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>${version.hamcrest}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
      <version>${version.hamcrest}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${version.mockito}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <!-- add LICENSE.txt to META-INF besides the main resources -->
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>${basedir}</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>LICENSE.txt</include>
        </includes>
      </resource>
    </resources>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${version.plugin.javadoc}</version>
          <configuration>
            <charset>UTF-8</charset>
            <docencoding>UTF-8</docencoding>
            <splitindex>true</splitindex>
            <author>true</author>
            <version>true</version>
            <notimestamp>true</notimestamp>
            <links>
              <!-- Use an HTTPS URL to the JSE docs -->
              <link>https://docs.oracle.com/javase/8/docs/api/</link>
            </links>
          </configuration>
        </plugin>

        <!-- this plugin is required to make Eclipse lifecycle errors disappear -->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <versionRange>[1.0,)</versionRange>
                    <goals>
                      <goal>run</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.plugin.compiler}</version>
        <configuration>
          <source>${version.java}</source>
          <target>${version.java}</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${version.plugin.dependency}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${version.plugin.jar}</version>
        <configuration>
          <archive>
            <manifestEntries>
              <Automatic-Module-Name>com.github.robtimus.obfuscation</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${version.plugin.source}</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${version.plugin.resources}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>com.github.robtimus</groupId>
        <artifactId>i18n-maven-plugin</artifactId>
        <version>${version.plugin.i18n}</version>
        <executions>
          <execution>
            <id>generate-messages</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <bundleName>com.github.robtimus.obfuscation.obfuscation</bundleName>
              <className>com.github.robtimus.obfuscation.Messages</className>
              <licenseText>Apache-2.0</licenseText>
              <licenseCopyrightHolder>Rob Spoor</licenseCopyrightHolder>
              <licenseCopyrightYear>2020</licenseCopyrightYear>
              <publicVisibility>false</publicVisibility>
              <suppressWarnings>nls</suppressWarnings>
            </configuration>
          </execution>
          <execution>
            <id>generate-support-messages</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <bundleName>com.github.robtimus.obfuscation.obfuscation-support</bundleName>
              <className>com.github.robtimus.obfuscation.support.Messages</className>
              <licenseText>Apache-2.0</licenseText>
              <licenseCopyrightHolder>Rob Spoor</licenseCopyrightHolder>
              <licenseCopyrightYear>2020</licenseCopyrightYear>
              <publicVisibility>false</publicVisibility>
              <suppressWarnings>nls</suppressWarnings>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>${version.plugin.antrun}</version>
        <executions>
          <execution>
            <id>copy-license</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <copy todir="${project.build.directory}/apidocs/META-INF">
                  <fileset dir="${basedir}">
                    <include name="LICENSE.txt" />
                  </fileset>
                </copy>
              </target>
            </configuration>
          </execution>
          <execution>
            <id>copy-readme</id>
            <phase>pre-site</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <concat destfile="${basedir}/src/site/markdown/index.md">
                  <fileset file="${basedir}/src/site/markdown/index.header.md" />
                  <fileset file="${basedir}/README.md" />
                </concat>
                <replaceregexp file="${basedir}/src/site/markdown/index.md" match="${project.url}" replace="" flags="g" />
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>${version.plugin.assembly}</version>
        <configuration>
          <descriptors>
            <descriptor>src/main/assembly/src.xml</descriptor>
            <descriptor>src/main/assembly/bin.xml</descriptor>
          </descriptors>
          <attach>false</attach>
        </configuration>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>${version.plugin.clean}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.plugin.surefire}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>${version.plugin.install}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${version.plugin.release}</version>
        <configuration>
          <tagNameFormat>@{project.version}</tagNameFormat>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <goals>deploy</goals>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>${version.plugin.gpg}</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>${version.plugin.nexus-staging}</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-deploy-plugin</artifactId>
        <version>${version.plugin.deploy}</version>
        <executions>
          <execution>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>${version.plugin.site}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>${version.plugin.info-reports}</version>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>${version.plugin.info-reports}</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>summary</report>
              <report>dependency-info</report>
              <report>dependencies</report>
              <report>licenses</report>
              <report>team</report>
              <report>scm</report>
              <report>issue-management</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${version.plugin.javadoc}</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>javadoc</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>
</project>
