<?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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.codeprimate</groupId>
    <artifactId>cp-core</artifactId>
    <version>1.7.0</version>
  </parent>

  <artifactId>cp-elements</artifactId>
  <version>1.0.0-M7</version>
  <packaging>jar</packaging>

  <name>Elements</name>
  <description>
    'Codeprimate Elements' (a.k.a. cp-elements, or simply Elements) is a Java library and micro-framework used to
    simplify the development of software applications written in Java. Elements packages several APIs into one
    library in order to address various application concerns and aspects of software design and development
    collectively. Elements is a highly simple, yet robust and proven library built on solid OO principles,
    software design patterns and best practices to effectively solve common and reoccurring problems
    in software development.
  </description>
  <inceptionYear>2011</inceptionYear>
  <url>http://www.codeprimate.org/projects/cp-elements</url>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <comments>
        Copyright 2011-Present Author or Authors.

        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.
      </comments>
    </license>
  </licenses>

  <organization>
    <name>Codeprimate, LLC</name>
    <url>http://www.codeprimate.org/</url>
  </organization>

  <developers>
    <developer>
      <id>jblum</id>
      <name>John J. Blum</name>
      <email>john dot blum at codeprimate dot org</email>
      <organization>Codeprimate, LLC.</organization>
      <organizationUrl>http://www.codeprimate.org</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:codeprimate-software/cp-elements.git</connection>
    <developerConnection>scm:git:git@github.com:codeprimate-software/cp-elements.git</developerConnection>
    <url>https://github.com/codeprimate-software/cp-elements</url>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/codeprimate-software/cp-elements/issues</url>
  </issueManagement>

  <properties>
    <java-module-name>org.codeprimate.elements</java-module-name>
    <build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
    <maven-changelog-plugin.version>2.3</maven-changelog-plugin.version>
  </properties>

  <build>
    <plugins>
<!--
      <plugin>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctor-maven-plugin</artifactId>
      </plugin>
-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven-jar-plugin.version}</version>
        <configuration>
          <archive>
            <manifest>
              <mainClass>org.cp.elements.ElementsVersion</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-inline</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>oracle-jdk-17</id>
      <activation>
        <jdk>[17,18)</jdk>
      </activation>
      <properties>
        <java.version>17</java.version>
      </properties>
    </profile>
    <profile>
      <id>oracle-jdk-14</id>
      <activation>
        <jdk>[14,15)</jdk>
      </activation>
      <properties>
        <java.version>14</java.version>
      </properties>
    </profile>
    <profile>
      <id>oracle-jdk-11</id>
      <activation>
        <jdk>[11,12)</jdk>
      </activation>
      <properties>
        <java.version>11</java.version>
      </properties>
    </profile>
    <profile>
      <id>oracle-jdk-9-jigsaw-and-later</id>
      <activation>
        <jdk>[1.9,)</jdk>
      </activation>
    </profile>
    <profile>
      <id>oracle-jdk</id>
      <activation>
        <file>
          <exists>${java.home}/../lib/tools.jar</exists>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.sun.tools</groupId>
          <artifactId>attach-api</artifactId>
          <version>${java.version}</version>
          <optional>true</optional>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>apple-jdk</id>
      <activation>
        <file>
          <exists>${java.home}/../Classes/classes.jar</exists>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.sun.tools</groupId>
          <artifactId>attach-api</artifactId>
          <version>1.6</version>
          <optional>true</optional>
          <scope>system</scope>
          <systemPath>${java.home}/../Classes/classes.jar</systemPath>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>prepare-release</id>
      <!-- $ mvn -P prepare-release install site -->
      <properties>
        <skipTests>false</skipTests>
      </properties>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-changelog-plugin</artifactId>
            <version>${maven-changelog-plugin.version}</version>
            <reportSets>
              <reportSet>
                <id>all-reports</id>
                <configuration>
                  <type>date</type>
                  <dates>
                    <date implementation="java.lang.String">2021-01-23</date>
                    <date implementation="java.lang.String">2022-04-24</date>
                  </dates>
                  <dateFormat>yyyy-MM-dd</dateFormat>
                </configuration>
                <reports>
                  <report>changelog</report>
                  <report>dev-activity</report>
                  <report>file-activity</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
        </plugins>
      </reporting>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>${build-helper-maven-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-artifacts</id>
                <phase>package</phase>
                <goals>
                  <goal>attach-artifact</goal>
                </goals>
                <configuration>
                  <artifacts>
                    <artifact>
                      <file>${project.build.directory}/${project.artifactId}-${project.version}-javadoc.jar</file>
                      <type>jar</type>
                      <classifier>javadoc</classifier>
                    </artifact>
                    <artifact>
                      <file>${project.build.directory}/${project.artifactId}-${project.version}-sources.jar</file>
                      <type>jar</type>
                      <classifier>sources</classifier>
                    </artifact>
                  </artifacts>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
