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

  <name>dotenv-kotlin</name>
  <description>Environment based config for the JVM</description>
  <url>https://github.com/cdimascio/dotenv-kotlin</url>

  <groupId>io.github.cdimascio</groupId>
  <artifactId>dotenv-kotlin</artifactId>
  <version>6.5.1</version>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>

  <organization>
    <name>Carmine DiMascio OSS</name>
    <url>https://github.com/cdimascio</url>
  </organization>

  <scm>
    <connection>scm:github:https://github.com/cdimascio/dotenv-kotlin</connection>
    <developerConnection>scm:github:https://github.com/cdimascio/dotenv-kotlin</developerConnection>
    <tag>master</tag>
    <url>https://github.com/cdimascio/dotenv-kotlin</url>
  </scm>

  <developers>
    <developer>
      <id>cdimascio</id>
      <name>Carmine DiMascio</name>
      <email>cdimascio@gmail.com</email>
      <url>https://www.github.com/cdimascio</url>
      <organization>Carmine DiMascio OSS</organization>
      <organizationUrl>https://www.github.com/cdimascio</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
      <timezone>America/New_York</timezone>
    </developer>
  </developers>

  <properties>
    <dotenv.version>3.2.0</dotenv.version>
    <maven.compiler.release>11</maven.compiler.release>
    <kotlin.version>1.9.22</kotlin.version>
    <main.class>io.cdimascio.DotenvKt</main.class>
    <junit.version>5.10.1</junit.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.plugin>3.12.1</maven.compiler.plugin>
    <maven.source.plugin>3.3.1</maven.source.plugin>
    <maven.javadoc.plugin>3.6.3</maven.javadoc.plugin>
    <maven.jar.plugin>3.3.0</maven.jar.plugin>
    <maven.jacoco.plugin>0.8.11</maven.jacoco.plugin>
    <maven.surefire.plugin>3.2.3</maven.surefire.plugin>
    <dokka.version>1.9.10</dokka.version>
    <bintray.subject>cdimascio</bintray.subject>
    <bintray.repo>maven</bintray.repo>
    <bintray.package>dotenv-kotlin</bintray.package>
  </properties>

  <pluginRepositories>
    <pluginRepository>
        <id>central</id>
        <name>Maven Central</name>
        <url>https://repo.maven.apache.org/maven2</url>
    </pluginRepository>
  </pluginRepositories>

  <dependencies>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib</artifactId>
      <version>${kotlin.version}</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>io.github.cdimascio</groupId>
      <artifactId>dotenv-java</artifactId>
      <version>${dotenv.version}</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-test-junit</artifactId>
      <version>${kotlin.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven.compiler.plugin}</version>
      </plugin>

      <plugin>
        <artifactId>kotlin-maven-plugin</artifactId>
        <groupId>org.jetbrains.kotlin</groupId>
        <version>${kotlin.version}</version>

        <executions>
          <execution>
            <id>compile</id>
            <phase>process-sources</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>

          <execution>
            <id>test-compile</id>
            <goals>
              <goal>test-compile</goal>
            </goals>
            <configuration>
              <sourceDirs>
                <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                <sourceDir>${project.basedir}/src/test/java</sourceDir>
              </sourceDirs>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven.jar.plugin}</version>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <mainClass>${main.class}</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven.surefire.plugin}</version>
        <configuration>
          <includes>
            <include>**/*.java</include>
          </includes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven.source.plugin}</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>
        <configuration>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>compile</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jetbrains.dokka</groupId>
        <artifactId>dokka-maven-plugin</artifactId>
        <version>${dokka.version}</version>
        <executions>
          <execution>
            <phase>prepare-package</phase>
            <goals>
              <goal>dokka</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <dokkaPlugins>
            <plugin>
              <groupId>org.jetbrains.dokka</groupId>
              <artifactId>kotlin-as-java-plugin</artifactId>
              <version>${dokka.version}</version>
            </plugin>
          </dokkaPlugins>
        </configuration>
      </plugin>

      <!--      <plugin>-->
      <!--        <groupId>org.jetbrains.dokka</groupId>-->
      <!--        <artifactId>dokka-maven-plugin</artifactId>-->
      <!--        <version>${dokka.version}</version>-->
      <!--        <executions>-->
      <!--          <execution>-->
      <!--            <phase>pre-site</phase>-->
      <!--            <goals>-->
      <!--              <goal>dokka</goal>-->
      <!--            </goals>-->
      <!--          </execution>-->
      <!--        </executions>-->
      <!--      </plugin>-->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${maven.jacoco.plugin}</version>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.13</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </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>
<!--    <repository>-->
<!--      <id>github</id>-->
<!--      <name>Carmine M DiMascio</name>-->
<!--      <url>https://maven.pkg.github.com/cdimascio/dotenv-kotlin</url>-->
<!--    </repository>-->
  </distributionManagement>
  <profiles>
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.4</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
