<!--

     Copyright 2020 - 2023 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.3.1.Final</version>
  </parent>

  <groupId>org.moditect.layrry</groupId>
  <artifactId>layrry-aggregator</artifactId>
  <version>1.0.0.Final</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>11</maven.compiler.target>
    <maven.compiler.release>11</maven.compiler.release>
    <!-- value comes from property git.commit.author.time -->
    <project.build.outputTimestamp>2023-05-03T09:41:01Z</project.build.outputTimestamp>
    <version.appsembler.plugin>2.1.0</version.appsembler.plugin>
    <version.assembly.plugin>3.5.0</version.assembly.plugin>
    <version.exec.plugin>3.1.0</version.exec.plugin>
    <version.shade.plugin>3.4.1</version.shade.plugin>
    <version.log4j>2.20.0</version.log4j>
    <gpg.skip>true</gpg.skip>
  </properties>

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

  <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>deploy</name>
          <value>!true</value>
        </property>
      </activation>
      <modules>
        <module>integration-test</module>
        <module>examples</module>
      </modules>
    </profile>
    <profile>
      <id>deploy</id>
      <activation>
        <property>
          <name>deploy</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <altDeploymentRepository>local::file:target/staging-deploy</altDeploymentRepository>
        <skipTests>true</skipTests>
        <maven.site.skip>true</maven.site.skip>
      </properties>
      <build>
        <defaultGoal>deploy</defaultGoal>
      </build>
    </profile>
    <profile>
      <id>jreleaser</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jreleaser</groupId>
            <artifactId>jreleaser-maven-plugin</artifactId>
            <version>1.6.0</version>
            <inherited>false</inherited>
            <configuration>
              <jreleaser>
                <project>
                  <stereotype>CLI</stereotype>
                </project>
                <release>
                  <github>
                    <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>
                <signing>
                  <active>ALWAYS</active>
                  <armored>true</armored>
                </signing>
                <deploy>
                  <maven>
                    <nexus2>
                      <maven-central>
                        <active>RELEASE</active>
                        <url>https://oss.sonatype.org/service/local</url>
                        <closeRepository>true</closeRepository>
                        <releaseRepository>true</releaseRepository>
                        <stagingRepositories>
                          <stagingRepository>target/staging-deploy</stagingRepository>
                        </stagingRepositories>
                      </maven-central>
                    </nexus2>
                  </maven>
                </deploy>
                <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>
                    <status>🚀 Layrry {{projectVersion}} has been released! {{releaseNotesUrl}}</status>
                  </twitter>
                  <mastodon>
                    <active>RELEASE</active>
                    <host>https://mastodon.social</host>
                    <status>🚀 Layrry {{projectVersion}} has been released! {{releaseNotesUrl}}</status>
                  </mastodon>
                </announce>
              </jreleaser>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
