<!--

     Copyright 2020 - 2022 The ModiTect 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.

-->
<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.moditect</groupId>
    <artifactId>moditect-org-parent</artifactId>
    <version>1.2.0.Final</version>
  </parent>

  <groupId>org.moditect.layrry</groupId>
  <artifactId>layrry-aggregator</artifactId>
  <version>1.0.0.Alpha2</version>
  <packaging>pom</packaging>

  <name>Layrry Aggregator</name>
  <description>A Launcher and API for Modularized Java Applications</description>
  <url>https://github.com/moditect/layrry</url>
  <inceptionYear>2020</inceptionYear>

  <properties>
    <project.identifier>layrry</project.identifier>
    <project.repository>moditect/layrry</project.repository>
    <local.repository.path>/tmp/repository</local.repository.path>
    <layrry.version>${project.version}</layrry.version>
    <!-- build requires Java 17 -->
    <java.version>17</java.version>
    <!-- bytecode compatibility set to 11 -->
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>1</maven.compiler.target>
    <maven.compiler.release>11</maven.compiler.release>
    <version.appsembler.plugin>2.1.0</version.appsembler.plugin>
    <version.assembly.plugin>3.4.2</version.assembly.plugin>
    <version.gpg.plugin>1.6</version.gpg.plugin> <!-- make it work with -pinentry-mode=loopback -->
    <version.nexus.plugin>1.6.13</version.nexus.plugin>
    <version.exec.plugin>3.1.0</version.exec.plugin>
    <version.shade.plugin>3.3.0</version.shade.plugin>
    <version.log4j>2.18.0</version.log4j>
  </properties>

  <scm>
    <connection>scm:git:${repository.url}</connection>
    <developerConnection>scm:git:${repository.url}</developerConnection>
    <url>${repository.url}</url>
    <tag>HEAD</tag>
  </scm>

  <developers>
    <developer>
      <id>gunnarmorling</id>
      <name>Gunnar Morling</name>
      <url>https://www.morling.dev</url>
      <roles>
        <role>author</role>
      </roles>
    </developer>
    <developer>
      <id>aalmiray</id>
      <name>Andres Almiray</name>
      <url>https://andresalmiray.com</url>
    </developer>
  </developers>

  <modules>
    <module>layrry-platform</module>
    <module>layrry-config</module>
    <module>layrry-config-yaml</module>
    <module>layrry-config-toml</module>
    <module>layrry-core</module>
    <module>layrry-launcher</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>layrry-platform</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>layrry-config</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>layrry-config-yaml</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>layrry-config-toml</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>layrry-core</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>layrry-launcher</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-bom</artifactId>
        <version>3.1.4</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.2</version>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest</artifactId>
        <version>2.2</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.36</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-server</artifactId>
        <version>9.4.41.v20210516</version>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>${version.log4j}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${version.log4j}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.12.0</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>${version.exec.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>${version.shade.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>appassembler-maven-plugin</artifactId>
          <version>${version.appsembler.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>${version.assembly.plugin}</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration combine.self="override">
          <header>${rootdir}/etc/license.txt</header>
          <strictCheck>true</strictCheck>
          <excludes>
            <exclude>*.dot</exclude>
            <exclude>README.adoc</exclude>
            <exclude>LICENSE.txt</exclude>
            <exclude>install-jdk.sh</exclude>
            <exclude>mvnw</exclude>
            <exclude>mvnw.cmd</exclude>
            <exclude>.mvn/wrapper/maven-wrapper.properties</exclude>
            <exclude>.mvn/wrapper/MavenWrapperDownloader.java</exclude>
          </excludes>
          <mapping>
            <yml>SCRIPT_STYLE</yml>
            <toml>SCRIPT_STYLE</toml>
          </mapping>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>test</id>
      <activation>
        <property>
          <name>release</name>
          <value>!true</value>
        </property>
      </activation>
      <modules>
        <module>integration-test</module>
        <module>examples</module>
      </modules>
    </profile>
    <profile>
      <id>jreleaser</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jreleaser</groupId>
            <artifactId>jreleaser-maven-plugin</artifactId>
            <version>1.3.0</version>
            <inherited>false</inherited>
            <configuration>
              <jreleaser>
                <project>
                  <stereotype>CLI</stereotype>
                </project>
                <release>
                  <github>
                    <branch>master</branch>
                    <skipTag>true</skipTag>
                    <issues>
                      <enabled>true</enabled>
                    </issues>
                    <changelog>
                      <formatted>ALWAYS</formatted>
                      <format>- {{commitShortHash}} {{commitTitle}}</format>
                      <contributors>
                        <format>* {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}</format>
                      </contributors>
                      <hide>
                        <contributors>
                          <contributor>GitHub</contributor>
                          <contributor>bot</contributor>
                        </contributors>
                      </hide>
                      <labelers>
                        <labeler>
                          <title>Issue #</title>
                          <label>feature</label>
                        </labeler>
                        <labeler>
                          <title>Bump</title>
                          <label>dependencies</label>
                        </labeler>
                        <labeler>
                          <title>Merge</title>
                          <label>merge</label>
                        </labeler>
                      </labelers>
                      <categories>
                        <category>
                          <key>feature</key>
                          <title>Features</title>
                          <labels>feature</labels>
                          <order>1</order>
                        </category>
                        <category>
                          <key>deps</key>
                          <title>Dependencies</title>
                          <labels>dependencies</labels>
                          <order>2</order>
                        </category>
                        <category>
                          <key>merge</key>
                          <title>merge</title>
                          <labels>merge</labels>
                          <order>0</order>
                        </category>
                      </categories>
                      <hide>
                        <categories>merge</categories>
                        <contributors>dependabot,GitHub</contributors>
                      </hide>
                    </changelog>
                  </github>
                </release>
                <distributions>
                  <layrry>
                    <sdkman>
                      <active>RELEASE</active>
                    </sdkman>
                    <artifacts>
                      <artifact>
                        <path>layrry-launcher/target/distributions/layrry-{{projectVersion}}.zip</path>
                      </artifact>
                      <artifact>
                        <path>layrry-launcher/target/distributions/layrry-{{projectVersion}}.tar.gz</path>
                      </artifact>
                    </artifacts>
                  </layrry>
                  <layrry-uberjar>
                    <type>SINGLE_JAR</type>
                    <artifacts>
                      <artifact>
                        <path>layrry-launcher/target/layrry-launcher-{{projectVersion}}-all.jar</path>
                      </artifact>
                    </artifacts>
                  </layrry-uberjar>
                </distributions>
                <announce>
                  <twitter>
                    <active>RELEASE</active>
                  </twitter>
                </announce>
              </jreleaser>
            </configuration>
            <dependencies>
              <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.11.0</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
