<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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>org.comixedproject</groupId>
  <artifactId>comixed</artifactId>
  <packaging>pom</packaging>
  <version>2.3.7</version>
  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.2.3</version>
  </parent>
  <name>comixed</name>
  <url>http://www.comixedproject.org</url>

  <scm>
    <connection>scm:git:git@github.com:comixed/comixed.git</connection>
    <developerConnection>scm:git:git@github.com:comixed/comixed.git</developerConnection>
    <url>scm:git:git@github.com:comixed/comixed.git</url>
    <tag>master</tag>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <name>Snapshot Repository OSSRH</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <name>Central Repository OSSRH</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/comixed/comixed/issues</url>
  </issueManagement>

  <repositories>
    <repository>
      <id>oss.sonatype.org-snapshot</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <properties>
    <assembly.name>local</assembly.name>
    <maven-git-code-format.version>5.1</maven-git-code-format.version>
    <git-code-format-maven-plugin.version>4.2</git-code-format-maven-plugin.version>
    <java.version>17</java.version>
    <sonar.organization>comixed</sonar.organization>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    <sonar.links.scm>https://github.com/comixed/comixed</sonar.links.scm>
    <sonar.links.issue>https://github.com/comixed/comixed/issues</sonar.links.issue>
    <sonar.sources>./src/main/java</sonar.sources>
    <sonar.exclusions>
      **/model/**,
      **/test/**,
      **/comixedproject/http/**,
      **/state/comicbooks/Comic*,
      **/state/lists/ReadingList*,
      **/state/lists/Story*,
      **/*Configuration,
      **/*Event,
      **/*Exception,
      **/*StateHandler,
      **/ComiXed*App
    </sonar.exclusions>
    <sonar.test.inclusions>**/test/**</sonar.test.inclusions>
    <spring-plugin.version>2.0.0.RELEASE</spring-plugin.version>
  </properties>
  <profiles>
    <profile>
      <id>dev</id>
      <activation>
        <activeByDefault>true</activeByDefault>
        <property>
          <name>env</name>
          <value>dev</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.cosium.code</groupId>
            <artifactId>git-code-format-maven-plugin</artifactId>
            <version>${maven-git-code-format.version}</version>
            <executions>
              <execution>
                <id>install-formatter-hook</id>
                <goals>
                  <goal>install-hooks</goal>
                </goals>
              </execution>
              <execution>
                <id>validate-code-format</id>
                <goals>
                  <goal>validate-code-format</goal>
                </goals>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>com.cosium.code</groupId>
                <artifactId>google-java-format</artifactId>
                <version>4.2</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ci</id>
      <activation>
        <property>
          <name>env</name>
          <value>ci</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.cosium.code</groupId>
            <artifactId>git-code-format-maven-plugin</artifactId>
            <version>${maven-git-code-format.version}</version>
            <executions>
              <execution>
                <id>install-formatter-hook</id>
                <goals>
                  <goal>install-hooks</goal>
                </goals>
              </execution>
              <execution>
                <id>validate-code-format</id>
                <goals>
                  <goal>validate-code-format</goal>
                </goals>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>com.cosium.code</groupId>
                <artifactId>google-java-format</artifactId>
                <version>${git-code-format-maven-plugin.version}</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>debugging</id>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <argument>--pinentry-mode</argument>
                    <argument>loopback</argument>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-aop</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-messaging</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents.client5</groupId>
      <artifactId>httpclient5</artifactId>
      <version>5.2.1</version>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-xml</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
    </dependency>
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <version>5.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <version>2.0.7</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-mockito2</artifactId>
      <version>2.0.7</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4-rule</artifactId>
      <version>2.0.7</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-aspects</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-instrument</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
      <groupId>org.imgscalr</groupId>
      <artifactId>imgscalr-lib</artifactId>
      <version>4.2</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <annotationProcessorPaths>
            <path>
              <groupId>org.projectlombok</groupId>
              <artifactId>lombok</artifactId>
              <version>${lombok.version}</version>
            </path>
          </annotationProcessorPaths>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.10</version>
        <configuration>
          <excludes>
            <exclude>**/model/**</exclude>
            <exclude>**/comixedproject/http/**</exclude>
            <exclude>**/*Exception*</exclude>
            <exclude>**/state/comicbooks/Comic*</exclude>
            <exclude>**/state/lists/ReadingList**</exclude>
            <exclude>**/state/lists/Story**</exclude>
            <exclude>**/batch/comicbooks/*Configuration</exclude>
            <exclude>**/*Event</exclude>
            <exclude>**/*Exception</exclude>
            <exclude>**/*StateHandler</exclude>
            <exclude>**/ComiXed*App</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>jacoco-site</id>
            <phase>verify</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <rules>
                <rule>
                  <element>BUNDLE</element>
                  <limits>
                    <limit>
                      <counter>INSTRUCTION</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.50</minimum>
                    </limit>
                  </limits>
                </rule>
                <!-- uncomment when testing has been brought up to 90% -->
                <!-- rule>
                  <element>CLASS</element>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.90</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.90</minimum>
                    </limit>
                    <limit>
                      <counter>CLASS</counter>
                      <value>MISSEDCOUNT</value>
                      <maximum>0</maximum>
                    </limit>
                  </limits>
                </rule -->
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-help-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>show-profiles</id>
            <phase>compile</phase>
            <goals>
              <goal>active-profiles</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>${project.basedir}</directory>
              <includes>comixed-release-*</includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.13</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>default-deploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.1</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-javadoc-plugin</artifactId>
        <version>3.6.3</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    <plugin>
      <groupId>com.github.danielflower.mavenplugins</groupId>
      <artifactId>gitlog-maven-plugin</artifactId>
      <version>1.14.0</version>
      <configuration>
        <reportTitle>Changelog for ComiXed v2.3.7</reportTitle>
        <verbose>false</verbose>
        <outputDirectory>${project.basedir}</outputDirectory>
        <generateMarkdownChangeLog>true</generateMarkdownChangeLog>
        <markdownChangeLogFilename>CHANGELOG.md</markdownChangeLogFilename>
        <generateSimpleHTMLChangeLog>false</generateSimpleHTMLChangeLog>
        <generatePlainTextChangeLog>false</generatePlainTextChangeLog>
        <generateAsciidocChangeLog>false</generateAsciidocChangeLog>
        <generateJSONChangeLog>false</generateJSONChangeLog>
        <generateHTMLTableOnlyChangeLog>false</generateHTMLTableOnlyChangeLog>
        <issueManagementSystem>GitHub issue tracker</issueManagementSystem>
        <issueManagementUrl>https://github.com/comixed/comixed/issues</issueManagementUrl>
        <fullGitMessage>false</fullGitMessage>
        <dateFormat>yyyy-MM-dd HH:mm:ss Z</dateFormat>
        <bugzillaPattern>(?:Bug|UPDATE|FIX|ADD|NEW|#) ?#?(\d+)</bugzillaPattern>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>generate</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    <plugin>
      <groupId>org.sonarsource.scanner.maven</groupId>
      <artifactId>sonar-maven-plugin</artifactId>
      <version>4.0.0.4121</version>
    </plugin>
    </plugins>
  </build>
  <modules>
    <module>comixed-model</module>
    <module>comixed-state</module>
    <module>comixed-repositories</module>
    <module>comixed-adaptors</module>
    <module>comixed-messaging</module>
    <module>comixed-services</module>
    <module>comixed-batch</module>
    <module>comixed-metadata</module>
    <module>comixed-plugins</module>
    <module>comixed-auth</module>
    <module>comixed-http</module>
    <module>comixed-opds</module>
    <module>comixed-rest</module>
    <module>comixed-webui</module>
    <module>comixed-app</module>
    <module>comixed-release</module>
  </modules>
</project>
