<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>
  <groupId>com.axonivy.ivy.ci</groupId>
  <artifactId>project-build-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <version>12.0.13</version>

  <name>Axon Ivy Project Build Plugin</name>
  <description>Maven plugin for the automated building of Axon Ivy Projects. Referenced from the pom.xml of Axon Ivy Projects.</description>
  <url>https://github.com/axonivy/project-build-plugin</url>
  <prerequisites>
    <maven>3.9.8</maven>
  </prerequisites>
  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Axon Ivy Project Build Authors</name>
      <email>support@ivyteam.ch</email>
      <organization>Axon Ivy AG</organization>
      <organizationUrl>https://www.axonivy.com</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:axonivy/project-build-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:axonivy/project-build-plugin.git</developerConnection>
    <url>git@github.com:axonivy/project-build-plugin.git</url>
    <tag>v8.0.3</tag>
  </scm>

  <organization>
    <name>Axon Ivy AG</name>
    <url>https://developer.axonivy.com</url>
  </organization>

  <properties>
    <java.version>21</java.version>
    <maven.version>3.9.14</maven.version>
    <slf4j.version>1.7.36</slf4j.version>
    <junit-jupiter.version>5.14.3</junit-jupiter.version>
    <site.path>snapshot</site.path>
    <other.site.path>release</other.site.path>
    <other.site.name>Stable</other.site.name>
    <autoRelease>false</autoRelease>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <distributionManagement>
    <snapshotRepository>
      <id>central.snapshots</id>
      <name>Maven Central Snapshots Repo</name>
      <url>https://central.sonatype.com/repository/maven-snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>central.releases</id>
      <name>Maven Central Releases Repo</name>
      <url>https://oss.sonatype.org/content/repositories/releases/</url>
    </repository>
    <site>
      <id>github</id>
      <url>scm:git:git@github.com:axonivy/project-build-plugin.git</url>
    </site>
  </distributionManagement>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-filtering</artifactId>
      <version>3.5.0</version>
      <!--NOT provided: will fail on consuming builds -->
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-sec-dispatcher</artifactId>
      <version>2.0</version>
      <!--NOT provided: will fail on consuming builds -->
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.15.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.wagon</groupId>
      <artifactId>wagon-http</artifactId>
      <version>3.5.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-compat</artifactId>
      <version>${maven.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.20.0</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.21.0</version>
    </dependency>
    <dependency>
      <groupId>net.lingala.zip4j</groupId>
      <artifactId>zip4j</artifactId>
      <version>2.11.6</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-archiver</artifactId>
      <version>4.10.0</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-yaml</artifactId>
      <version>2.21.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.14</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpmime</artifactId>
      <version>4.5.14</version>
      <scope>compile</scope>
    </dependency>

    <!-- Logging environment: Required for engine classLoader (but not for the plugin runtime itself) -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>log4j-over-slf4j</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>${slf4j.version}</version>
    </dependency>

    <!-- TEST scoped -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit-jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.27.7</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>4.3.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-testing</groupId>
      <artifactId>maven-plugin-testing-harness</artifactId>
      <version>3.5.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mock-server</groupId>
      <artifactId>mockserver-netty-no-dependencies</artifactId>
      <version>5.15.0</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>src/main/resources-filtered</directory>
        <targetPath>ch/ivyteam/ivy/maven/engine</targetPath>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.15.0</version>
        <configuration>
          <release>${java.version}</release>
          <showDeprecation>true</showDeprecation>
        </configuration>
      </plugin>
      <plugin>
        <!-- Makes MOJO declaration trough Annotation possible. -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.15.2</version>
        <configuration>
          <!-- see http://jira.codehaus.org/browse/MNG-5346 -->
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
          <goalPrefix>ivy</goalPrefix>
        </configuration>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals><goal>descriptor</goal></goals>
          </execution>
          <execution>
            <id>help-goal</id>
            <goals><goal>helpmojo</goal></goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <version>3.9.1</version>
        <configuration>
          <projectsDirectory>integration-tests/</projectsDirectory>
          <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo>
          <cloneAllFiles>true</cloneAllFiles>
          <properties>
            <project.build.plugin.version>${project.version}</project.build.plugin.version>
            <ivy.engine.list.url>${ivy.engine.list.url}</ivy.engine.list.url>
            <ivy.engine.version.latest.minor>true</ivy.engine.version.latest.minor>
          </properties>
        </configuration>
        <executions>
          <execution>
            <id>integration-test.build.plugin</id>
            <phase>integration-test</phase>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.6.1</version>
        <executions>
          <execution>
            <id>parse.version.property</id>
            <goals><goal>parse-version</goal></goals>
            <phase>pre-site</phase>
            <configuration>
              <propertyPrefix>pluginVersion</propertyPrefix>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <phase>site</phase>
            <goals><goal>run</goal></goals>
            <id>gh-pages.redirect.page</id>
            <configuration>
              <target>
                <move todir="${project.build.directory}/site/${site.path}/${pluginVersion.majorVersion}.${pluginVersion.minorVersion}">
                  <fileset dir="${project.build.directory}/site" />
                </move>
                <copy todir="${project.build.directory}/site/${site.path}/">
                  <fileset dir="src/site/gh/pages/" />
                  <filterset id="replaceProductAndVersion">
                    <filter token="version" value="${pluginVersion.majorVersion}.${pluginVersion.minorVersion}" />
                  </filterset>
                </copy>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-publish-plugin</artifactId>
        <version>3.3.0</version>
        <configuration>
          <scmBranch>gh-pages</scmBranch>
          <skipDeletedFiles>true</skipDeletedFiles>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.cyclonedx</groupId>
        <artifactId>cyclonedx-maven-plugin</artifactId>
        <version>2.9.1</version>
        <executions>
          <execution>
            <phase>package</phase>
              <goals>
                <goal>makeBom</goal>
               </goals>
           </execution>
        </executions>
        <configuration>
          <outputFormat>json</outputFormat>
          <includeLicenseText>true</includeLicenseText>
        </configuration>
      </plugin>
    </plugins>
    
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.21.0</version>
          <executions>
            <execution>
              <id>default-deploy</id><!-- use github pages instead! -->
              <configuration>
                <skipDeploy>true</skipDeploy>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  
  <profiles>
    <profile>
      <id>centralDeploy</id>
      <properties>
        <site.path>release</site.path>
        <other.site.path>snapshot</other.site.path>
        <other.site.name>Snapshot</other.site.name>
        <maven.test.skip>true</maven.test.skip>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.4.0</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.8</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <passphrase>${gpg.project-build.password}</passphrase>
                  <keyname>72B12346</keyname>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.12.0</version>
            <configuration>
              <release>${java.version}</release>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.10.0</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central.releases</publishingServerId>
              <autoPublish>${autoRelease}</autoPublish>
              <waitUntil>published</waitUntil>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
    
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-utils</artifactId>
        <version>3.6.0</version><!-- make compliant with plexus-archiver:4x -->
      </dependency>
    </dependencies>
  </dependencyManagement>
  
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-report-plugin</artifactId>
        <version>3.15.2</version>
        <configuration>
          <requirements>
            <others>
              <property>
                <name>ivy engine</name>
                <value>12.0</value>
              </property>
            </others>
          </requirements>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.9.0</version>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
</project>
