<?xml version="1.0" encoding="UTF-8"?>
<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>
  <artifactId>dialob-parent</artifactId>
  <groupId>io.dialob</groupId>
  <version>2.1.2</version>
  <packaging>pom</packaging>
  <inceptionYear>2015 - 2021</inceptionYear>

  <organization>
    <name>Copyright 2021 ReSys OÜ</name>
  </organization>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <url>http://github.com/dialob/dialob-parent</url>
  <description>Form Engine</description>
  <name>dialob-parent</name>
  <developers>
    <developer>
      <name>Villu Vaimets</name>
      <email>villu.vaimets@resys.io</email>
      <organization>ReSys OÜ</organization>
      <organizationUrl>http://www.resys.io</organizationUrl>
    </developer>
    <developer>
      <name>Tomi Pakarinen</name>
      <email>tomi.pakarinen@resys.io</email>
      <organization>ReSys OÜ</organization>
      <organizationUrl>http://www.resys.io</organizationUrl>
    </developer>
    <developer>
      <name>Olev Mutso</name>
      <email>olev.mutso@resys.io</email>
      <organization>ReSys OÜ</organization>
      <organizationUrl>http://www.resys.io</organizationUrl>
    </developer>
    <developer>
      <name>Jocelyn Mutso</name>
      <email>jocelyn.mutso@resys.io</email>
      <organization>ReSys OÜ</organization>
      <organizationUrl>http://www.resys.io</organizationUrl>
    </developer>
  </developers>


  <scm>
    <connection>scm:git:https://github.com/dialob/dialob-parent.git</connection>
    <developerConnection>scm:git:https://github.com/dialob/dialob-parent.git</developerConnection>
    <url>http://github.com/dialob/dialob-parent/tree/main</url>
    <tag>HEAD</tag>
  </scm>

  <distributionManagement>
    <repository>
      <id>oss.sonatype.org</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>oss.sonatype.org</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>


  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <modules>
    <module>dialob-bom</module>
    <module>dialob-build-parent</module>
    <module>dialob-config-parent</module>
    <module>dialob-security-parent</module>
    <module>dialob-components</module>
    <module>dialob-boot</module>
    <module>dialob-session-boot</module>
    <module>dialob-spring-boot</module>
  </modules>

  <profiles>
    <profile>
      <id>jenkins-agent</id>
      <activation>
        <property>
          <name>env.JENKINS_AGENT_WORKDIR</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>3.0.0-M5</version>
              <configuration>
                <systemPropertyVariables>
                  <jenkins.agent.workdir>${env.JENKINS_AGENT_WORKDIR}</jenkins.agent.workdir>
                  <jenkins.agent.tmpdir>${env.JENKINS_AGENT_TMPDIR}</jenkins.agent.tmpdir>
                  <jenkins.agent.cachedir>${env.JENKINS_AGENT_CACHEDIR}</jenkins.agent.cachedir>
                </systemPropertyVariables>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>no-snapshots</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
              <execution>
                <id>enforce-no-snapshots</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireReleaseDeps>
                      <message>No Snapshots Allowed!</message>
                    </requireReleaseDeps>
                  </rules>
                  <fail>true</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>local-dev</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>com.google.cloud.tools</groupId>
              <artifactId>jib-maven-plugin</artifactId>
              <version>${jib-maven-plugin.version}</version>
              <executions>
                <execution>
                  <id>docker-build</id>
                  <phase>install</phase>
                  <goals>
                    <goal>dockerBuild</goal>
                  </goals>
                  <configuration>
                    <to>
                      <image>${project.artifactId}</image>
                    </to>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.7</version>
            <executions>
              <execution>
                <id>default-prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <includes>
                    <include>io.dialob.*</include>
                  </includes>
                  <excludes>
                    <exclude>**/*Test.class</exclude>
                  </excludes>
                </configuration>
              </execution>
              <execution>
                <id>default-report</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>update-license-headers</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <version>4.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>format</goal>
                </goals>
              </execution>
            </executions>
            
          </plugin>
        </plugins>
      </build>
    </profile>


    <profile>
      <id>dialob-release</id>
      <build>
        <plugins>

          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>2.1</version>
            <configuration>
              <generateBackupPoms>false</generateBackupPoms>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>3.0.0-M1</version>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.2.0</version>
            <executions>
              <execution>
                <id>package-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.2.0</version>
            <executions>
              <execution>
                <id>package-javadoc</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>oss.sonatype.org</serverId>
              <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
            </configuration>
            <executions>
              <execution>
                <id>deploy-to-sonatype</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                  <goal>release</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
