<?xml version="1.0" encoding="UTF-8"?>
<!--
	Copyright 2023 Vitalij Berdinskih

	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 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>uk.bot-by.maven-plugin</groupId>
  <artifactId>ijhttp-maven-plugin</artifactId>
  <version>1.0.1</version>
  <packaging>maven-plugin</packaging>
  <name>IntelliJ HTTP Client Maven Plugin</name>
  <description>Run HTTP requests of integration tests</description>
  <url>https://gitlab.com/bot-by/ijhttp-maven-plugin</url>
  <inceptionYear>2023</inceptionYear>
  <organization>
    <name>bot-by</name>
    <url>https://bot-by.uk</url>
  </organization>
  <licenses>
    <license>
      <name>Apache 2</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
      <comments>See NOTICE for third-party licenses.</comments>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>vitalijr2</id>
      <name>Vitalij Berdinskih</name>
      <email>vitalij_r2@outlook.com</email>
      <url>https://gitlab.com/vitalijr2</url>
      <timezone>Europe/Kyiv</timezone>
    </developer>
  </developers>
  <prerequisites>
    <maven>3.8.5</maven>
  </prerequisites>
  <scm>
    <connection>scm:git:https://gitlab.com/bot-by/ijhttp-maven-plugin.git</connection>
    <developerConnection>scm:git:git@gitlab.com:bot-by/ijhttp-maven-plugin.git</developerConnection>
    <url>https://gitlab.com/bot-by/ijhttp-maven-plugin</url>
  </scm>
  <issueManagement>
    <system>GitLab</system>
    <url>https://gitlab.com/bot-by/ijhttp-maven-plugin/-/issues</url>
  </issueManagement>
  <ciManagement>
    <system>GitLab</system>
    <url>https://gitlab.com/bot-by/ijhttp-maven-plugin/-/pipelines</url>
  </ciManagement>
  <properties>
    <java.version>17</java.version>
    <plugin-annotations.version>3.10.2</plugin-annotations.version>
    <mockito.version>5.7.0</mockito.version>
    <github.release.url>https://github.com/bot-by/ijhttp-maven-plugin/releases</github.release.url>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <revision>1.0.1</revision>
    <sha1></sha1>
    <junit-jupiter.version>5.10.1</junit-jupiter.version>
    <changelist>-SNAPSHOT</changelist>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <plugin-api.version>3.9.4</plugin-api.version>
    <javadoc-plugin.version>3.6.2</javadoc-plugin.version>
    <gitlab.release.url>https://gitlab.com/bot-by/ijhttp-maven-plugin/-/releases</gitlab.release.url>
    <maven-minimal.version>3.8.5</maven-minimal.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${plugin-api.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>${plugin-annotations.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains</groupId>
      <artifactId>annotations</artifactId>
      <version>24.0.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-exec</artifactId>
      <version>1.3</version>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit-jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit-jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>${junit-jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <version>2.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <defaultGoal>clean verify</defaultGoal>
    <plugins>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.3.2</version>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.4.1</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
          </execution>
          <execution>
            <id>enforce-clean</id>
            <phase>pre-clean</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <rules>
            <requireJavaVersion>
              <version>${java.version}</version>
            </requireJavaVersion>
            <requireMavenVersion>
              <version>${maven-minimal.version}</version>
            </requireMavenVersion>
          </rules>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>1.5.0</version>
        <executions>
          <execution>
            <id>flatten</id>
            <phase>process-resources</phase>
            <goals>
              <goal>flatten</goal>
            </goals>
          </execution>
          <execution>
            <id>clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <flattenMode>resolveCiFriendliesOnly</flattenMode>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.3.1</version>
        <configuration>
          <propertiesEncoding>ISO-8859-1</propertiesEncoding>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
        <configuration>
          <release>${java.version}</release>
          <showDeprecation>true</showDeprecation>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>${plugin-annotations.version}</version>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <execution>
            <id>help-goal</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <goalPrefix>ijhttp</goalPrefix>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.2.2</version>
        <configuration>
          <properties>
            <groups>fast</groups>
          </properties>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>3.2.2</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <forkCount>1</forkCount>
          <includes>
            <include>**/*Test.java</include>
          </includes>
          <properties>
            <groups>slow</groups>
          </properties>
          <reuseForks>false</reuseForks>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.11</version>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <configuration>
              <destFile>${project.build.directory}/jacoco-ut.exec</destFile>
            </configuration>
          </execution>
          <execution>
            <id>prepare-agent-integration</id>
            <goals>
              <goal>prepare-agent-integration</goal>
            </goals>
          </execution>
          <execution>
            <id>merge-results</id>
            <phase>verify</phase>
            <goals>
              <goal>merge</goal>
            </goals>
            <configuration>
              <destFile>${project.build.directory}/jacoco.exec</destFile>
              <fileSets>
                <fileSet>
                  <directory>${project.build.directory}</directory>
                  <includes>
                    <include>*.exec</include>
                  </includes>
                </fileSet>
              </fileSets>
            </configuration>
          </execution>
          <execution>
            <id>report</id>
            <phase>verify</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <dataFile>${project.build.directory}/jacoco.exec</dataFile>
              <outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
            </configuration>
          </execution>
          <execution>
            <id>check-coverage</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <dataFile>${project.build.directory}/jacoco.exec</dataFile>
              <rules>
                <rule>
                  <element>BUNDLE</element>
                  <limits>
                    <limit>
                      <counter>COMPLEXITY</counter>
                      <minimum>0.72</minimum>
                      <value>COVEREDRATIO</value>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <exclude>uk/bot_by/maven_plugin/ijhttp_maven_plugin/HelpMojo.class</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>run-its</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>3.6.0</version>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
              <goals>
                <goal>clean</goal>
                <goal>verify</goal>
              </goals>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
              </pomIncludes>
              <postBuildHookScript>verify</postBuildHookScript>
              <settingsFile>src/it/settings.xml</settingsFile>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>sign-and-deploy</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.simplify4u.plugins</groupId>
            <artifactId>sign-maven-plugin</artifactId>
            <version>1.0.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>sign</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>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
              <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
              <serverId>ossrh</serverId>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>javadocs</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${javadoc-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <additionalJOptions>
                <additionalJOption>-J-Dhttp.agent=maven-javadoc-plugin_${project.groupId}:${project.artifactId}</additionalJOption>
              </additionalJOptions>
              <additionalOptions>
                <additionalOption>--allow-script-in-comments</additionalOption>
              </additionalOptions>
              <bottom>&lt;script type="text/javascript" src="{@docRoot}/resources/prism.js">&lt;/script></bottom>
              <docfilessubdirs>true</docfilessubdirs>
              <doclint>none</doclint>
              <isOffline>false</isOffline>
              <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
              <links>
                <link>https://javadoc.io/doc/org.apache.maven/maven-plugin-api/${plugin-api.version}</link>
                <link>https://javadoc.io/doc/org.apache.maven.plugin-tools/maven-plugin-annotations/${plugin-annotations.version}</link>
              </links>
              <show>public</show>
              <top>&lt;link rel="stylesheet" type="text/css" href="{@docRoot}/resources/prism.css"/>
&lt;link rel="stylesheet" type="text/css" href="{@docRoot}/resources/ijhttp-maven-plugin.css"/></top>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>sources</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.3.0</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>site</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.12.1</version>
            <dependencies>
              <dependency>
                <groupId>com.bernardomg.maven.skins</groupId>
                <artifactId>docs-maven-skin</artifactId>
                <version>2.3.2</version>
              </dependency>
            </dependencies>
            <configuration>
              <stagingDirectory>public</stagingDirectory>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <site>
          <id>${project.artifactId}-site</id>
          <url>./</url>
        </site>
      </distributionManagement>
      <reporting>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${javadoc-plugin.version}</version>
            <reportSets>
              <reportSet>
                <id>aggregate</id>
                <reports>
                  <report>aggregate</report>
                </reports>
                <inherited>false</inherited>
              </reportSet>
              <reportSet>
                <reports>
                  <report>javadoc</report>
                </reports>
              </reportSet>
            </reportSets>
            <configuration>
              <doclint>none</doclint>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>3.4.5</version>
            <reportSets>
              <reportSet>
                <reports>
                  <report>ci-management</report>
                  <report>dependencies</report>
                  <report>issue-management</report>
                  <report>licenses</report>
                  <report>scm</report>
                  <report>team</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
        </plugins>
      </reporting>
    </profile>
  </profiles>
</project>
