<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.0.RELEASE</version>
    <relativePath/>
  </parent>

  <groupId>com.frox.opendpm</groupId>
  <artifactId>dpm-json</artifactId>
  <version>1.1.0</version>
  <packaging>pom</packaging>

  <name>dpm-json</name>
  <description>Json handling and manipulation tool for easy use in Camunda scripts with Groovy</description>
  <url>https://github.com/frox-ag/dpm-json</url>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Open Dpm</name>
      <email>opendpm@frox.ch</email>
      <organization>FROX AG</organization>
      <organizationUrl>https://www.frox.ch</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/frox-ag/dpm-json.git</connection>
    <developerConnection>scm:git:ssh://github.com:frox-ag/dpm-json.git</developerConnection>
    <url>https://github.com/frox-ag/dpm-json/tree/master</url>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <java.version>11</java.version>
    <camunda.version>7.14.0</camunda.version>
    <camunda.spin.version>1.7.5</camunda.spin.version>
    <groovy.all.version>2.4.15</groovy.all.version>
  </properties>

  <modules>
    <module>server</module>
    <module>starter</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.camunda.spin</groupId>
        <artifactId>camunda-spin-core</artifactId>
        <version>${camunda.spin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.camunda.spin</groupId>
        <artifactId>camunda-spin-dataformat-all</artifactId>
        <version>${camunda.spin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.camunda.bpm.springboot</groupId>
        <artifactId>camunda-bpm-spring-boot-starter</artifactId>
        <version>${camunda.version}</version>
      </dependency>

      <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <version>${groovy.all.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <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-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>groovydoc</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target>
                    <taskdef name="groovydoc"
                      classname="org.codehaus.groovy.ant.Groovydoc"
                      classpathref="maven.compile.classpath"
                    />
                    <groovydoc destdir="${project.build.directory}/apidocs"
                      sourcepath="${basedir}/src/main/java" use="true"
                      windowtitle="${project.name}"
                      doctitle="${project.name}"
                    />
                  </target>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-all</artifactId>
                <version>${groovy.all.version}</version>
              </dependency>
            </dependencies>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <excludePackageNames>*</excludePackageNames>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</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>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerId>groovy-eclipse-compiler</compilerId>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-compiler</artifactId>
            <version>3.6.0-03</version>
          </dependency>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-batch</artifactId>
            <version>${groovy.version}-01</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

</project>