<?xml version="1.0" encoding="UTF-8"?>
<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>
  <parent>
    <groupId>org.alfresco</groupId>
    <artifactId>alfresco-apa-java-rest-api</artifactId>
    <version>7.12.0-alpha.13</version>
  </parent>
  <groupId>org.alfresco</groupId>
  <artifactId>alfresco-apa-java-rest-api-lib</artifactId>
  <version>7.12.0-alpha.13</version>
  <packaging>pom</packaging>
  <name>Alfresco Process REST API</name>
  <description>${project.name}</description>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>
  <modules>
    <module>generated/alfresco-activiti-deployment-rest-api</module>
    <module>generated/alfresco-activiti-modeling-rest-api</module>
    <module>generated/alfresco-activiti-form-rest-api</module>
    <module>generated/alfresco-activiti-preference-rest-api</module>
    <module>generated/alfresco-activiti-query-rest-api</module>
    <module>generated/alfresco-activiti-runtime-rest-api</module>
    <module>generated/alfresco-activiti-audit-rest-api</module>
    <module>generated/alfresco-activiti-dmn-simulation-rest-api</module>
    <module>generated/alfresco-activiti-script-modeling-rest-api</module>
    <module>generated/alfresco-activiti-admin-preference-rest-api</module>
  </modules>
  <properties>
    <swagger-codegen-maven-plugin.groupId>io.swagger.codegen.v3</swagger-codegen-maven-plugin.groupId>
    <swagger-core.version>1.5.20</swagger-core.version>
    <swagger-core-v3-version>2.2.14</swagger-core-v3-version>
    <project.build.generatedSourceDirectory>generated</project.build.generatedSourceDirectory>
    <swagger-codegen-maven-plugin.version>3.0.46</swagger-codegen-maven-plugin.version>
    <spring-boot.version>${project.parent.version}</spring-boot.version>
    <exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>${spring-cloud.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-annotations</artifactId>
        <version>${swagger-core.version}</version>
      </dependency>
      <dependency>
        <groupId>io.swagger.core.v3</groupId>
        <artifactId>swagger-annotations</artifactId>
        <version>${swagger-core-v3-version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <repositories>
    <repository>
      <id>alfresco-internal</id>
      <url>https://artifacts.alfresco.com/nexus/content/groups/internal</url>
    </repository>
  </repositories>
  <profiles>
    <profile>
      <id>generate</id>
      <activation>
        <property>
          <name>!skip.generation</name>
        </property>
      </activation>
      <build>
        <resources>
          <resource>
            <filtering>true</filtering>
            <directory>src/main/resources</directory>
          </resource>
        </resources>
        <plugins>
          <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <inherited>false</inherited>
            <configuration>
              <filesets>
                <fileset>
                  <directory>generated</directory>
                </fileset>
              </filesets>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>process-templates</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>resources</goal>
                </goals>
              </execution>
            </executions>
            <inherited>false</inherited>
          </plugin>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>get-dependencies</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>com.alfresco.process</groupId>
                      <artifactId>alfresco-deployment-service</artifactId>
                      <version>${alfresco-deployment-service.version}</version>
                      <classifier>api-docs</classifier>
                      <type>json</type>
                    </artifactItem>
                    <artifactItem>
                      <groupId>com.alfresco.process</groupId>
                      <artifactId>alfresco-starter-modeling</artifactId>
                      <version>${alfresco-modeling-service.version}</version>
                      <classifier>api-docs</classifier>
                      <type>json</type>
                    </artifactItem>
                    <artifactItem>
                      <groupId>com.alfresco.process</groupId>
                      <artifactId>alfresco-process-dmn-simulation-spring-boot-starter</artifactId>
                      <version>${alfresco-process.version}</version>
                      <classifier>api-docs</classifier>
                      <type>json</type>
                    </artifactItem>
                    <artifactItem>
                      <groupId>com.alfresco.process</groupId>
                      <artifactId>alfresco-process-preference-spring-boot-starter</artifactId>
                      <version>${alfresco-process.version}</version>
                      <classifier>api-docs</classifier>
                      <type>json</type>
                    </artifactItem>
                    <artifactItem>
                      <groupId>com.alfresco.process</groupId>
                      <artifactId>alfresco-process-script-simulation-spring-boot-starter</artifactId>
                      <version>${alfresco-process.version}</version>
                      <classifier>api-docs</classifier>
                      <type>json</type>
                    </artifactItem>
                    <artifactItem>
                      <groupId>com.alfresco.process</groupId>
                      <artifactId>alfresco-process-form-spring-boot-starter</artifactId>
                      <version>${alfresco-process.version}</version>
                      <classifier>api-docs</classifier>
                      <type>json</type>
                    </artifactItem>
                    <artifactItem>
                      <groupId>com.alfresco.process</groupId>
                      <artifactId>alfresco-process-query-service</artifactId>
                      <version>${alfresco-process.version}</version>
                      <classifier>api-docs</classifier>
                      <type>json</type>
                    </artifactItem>
                    <artifactItem>
                      <groupId>com.alfresco.process</groupId>
                      <artifactId>alfresco-process-runtime-bundle-service</artifactId>
                      <version>${alfresco-process.version}</version>
                      <classifier>api-docs</classifier>
                      <type>json</type>
                    </artifactItem>
                    <artifactItem>
                      <groupId>org.activiti.cloud</groupId>
                      <artifactId>activiti-cloud-starter-audit</artifactId>
                      <version>${activiti-cloud.version}</version>
                      <classifier>api-docs</classifier>
                      <type>json</type>
                    </artifactItem>
                  </artifactItems>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>${swagger-codegen-maven-plugin.groupId}</groupId>
            <artifactId>swagger-codegen-maven-plugin</artifactId>
            <version>${swagger-codegen-maven-plugin.version}</version>
            <executions>
              <execution>
                <id>generate-activiti-dmn-simulation-api</id>
                <goals>
                  <goal>generate</goal>
                </goals>
                <configuration>
                  <inputSpec>${project.build.directory}/alfresco-process-dmn-simulation-spring-boot-starter-${alfresco-process.version}-api-docs.json</inputSpec>
                  <output>${project.build.generatedSourceDirectory}/alfresco-activiti-dmn-simulation-rest-api</output>
                  <artifactId>alfresco-activiti-dmn-simulation-rest-api</artifactId>
                  <configOptions>
                    <apiPackage>${project.groupId}.activiti.dmn.simulation.handler</apiPackage>
                    <modelPackage>${project.groupId}.activiti.dmn.simulation.model</modelPackage>
                    <invokerPackage>${project.groupId}.activiti.dmn.simulation</invokerPackage>
                  </configOptions>
                </configuration>
              </execution>
              <execution>
                <id>generate-activiti-script-modeling-api</id>
                <goals>
                  <goal>generate</goal>
                </goals>
                <configuration>
                  <inputSpec>${project.build.directory}/alfresco-process-script-simulation-spring-boot-starter-${alfresco-process.version}-api-docs.json</inputSpec>
                  <output>${project.build.generatedSourceDirectory}/alfresco-activiti-script-modeling-rest-api</output>
                  <artifactId>alfresco-activiti-script-modeling-rest-api</artifactId>
                  <configOptions>
                    <apiPackage>${project.groupId}.activiti.script.modeling.handler</apiPackage>
                    <modelPackage>${project.groupId}.activiti.script.modeling.model</modelPackage>
                    <invokerPackage>${project.groupId}.activiti.script.modeling</invokerPackage>
                  </configOptions>
                </configuration>
              </execution>
              <execution>
                <id>alfresco-activiti-deployment-rest-api</id>
                <goals>
                  <goal>generate</goal>
                </goals>
                <configuration>
                  <inputSpec>${project.build.directory}/alfresco-deployment-service-${alfresco-deployment-service.version}-api-docs.json</inputSpec>
                  <output>${project.build.generatedSourceDirectory}/alfresco-activiti-deployment-rest-api</output>
                  <artifactId>alfresco-activiti-deployment-rest-api</artifactId>
                  <configOptions>
                    <apiPackage>${project.groupId}.activiti.deployment.handler</apiPackage>
                    <modelPackage>${project.groupId}.activiti.deployment.model</modelPackage>
                    <invokerPackage>${project.groupId}.activiti.deployment</invokerPackage>
                  </configOptions>
                </configuration>
              </execution>
              <execution>
                <id>alfresco-activiti-admin-preference-rest-api</id>
                <goals>
                  <goal>generate</goal>
                </goals>
                <configuration>
                  <inputSpec>${project.build.directory}/alfresco-process-preference-spring-boot-starter-${alfresco-process.version}-api-docs.json</inputSpec>
                  <output>${project.build.generatedSourceDirectory}/alfresco-activiti-admin-preference-rest-api</output>
                  <artifactId>alfresco-activiti-admin-preference-rest-api</artifactId>
                  <configOptions>
                    <apiPackage>${project.groupId}.activiti.admin.preference.handler</apiPackage>
                    <modelPackage>${project.groupId}.activiti.admin.preference.model</modelPackage>
                    <invokerPackage>${project.groupId}.activiti.admin.preference</invokerPackage>
                  </configOptions>
                </configuration>
              </execution>
              <execution>
                <id>alfresco-activiti-modeling-rest-api</id>
                <goals>
                  <goal>generate</goal>
                </goals>
                <configuration>
                  <inputSpec>${project.build.directory}/alfresco-starter-modeling-${alfresco-modeling-service.version}-api-docs.json</inputSpec>
                  <output>${project.build.generatedSourceDirectory}/alfresco-activiti-modeling-rest-api</output>
                  <artifactId>alfresco-activiti-modeling-rest-api</artifactId>
                  <configOptions>
                    <apiPackage>${project.groupId}.activiti.modeling.handler</apiPackage>
                    <modelPackage>${project.groupId}.activiti.modeling.model</modelPackage>
                    <invokerPackage>${project.groupId}.activiti.modeling</invokerPackage>
                  </configOptions>
                </configuration>
              </execution>
              <execution>
                <id>generate-activiti-preference-api</id>
                <goals>
                  <goal>generate</goal>
                </goals>
                <configuration>
                  <inputSpec>${project.build.directory}/alfresco-process-preference-spring-boot-starter-${alfresco-process.version}-api-docs.json</inputSpec>
                  <output>${project.build.generatedSourceDirectory}/alfresco-activiti-preference-rest-api</output>
                  <artifactId>alfresco-activiti-preference-rest-api</artifactId>
                  <configOptions>
                    <apiPackage>${project.groupId}.activiti.preference.handler</apiPackage>
                    <modelPackage>${project.groupId}.activiti.preference.model</modelPackage>
                    <invokerPackage>${project.groupId}.activiti.preference</invokerPackage>
                  </configOptions>
                </configuration>
              </execution>
              <execution>
                <id>generate-activiti-form-api</id>
                <goals>
                  <goal>generate</goal>
                </goals>
                <configuration>
                  <inputSpec>${project.build.directory}/alfresco-process-form-spring-boot-starter-${alfresco-process.version}-api-docs.json</inputSpec>
                  <output>${project.build.generatedSourceDirectory}/alfresco-activiti-form-rest-api</output>
                  <artifactId>alfresco-activiti-form-rest-api</artifactId>
                  <configOptions>
                    <apiPackage>${project.groupId}.activiti.form.handler</apiPackage>
                    <modelPackage>${project.groupId}.activiti.form.model</modelPackage>
                    <invokerPackage>${project.groupId}.activiti.form</invokerPackage>
                  </configOptions>
                </configuration>
              </execution>
              <execution>
                <id>generate-activiti-query-api</id>
                <goals>
                  <goal>generate</goal>
                </goals>
                <configuration>
                  <inputSpec>${project.build.directory}/alfresco-process-query-service-${alfresco-process.version}-api-docs.json</inputSpec>
                  <output>${project.build.generatedSourceDirectory}/alfresco-activiti-query-rest-api</output>
                  <artifactId>alfresco-activiti-query-rest-api</artifactId>
                  <configOptions>
                    <apiPackage>${project.groupId}.activiti.query.handler</apiPackage>
                    <modelPackage>${project.groupId}.activiti.query.model</modelPackage>
                    <invokerPackage>${project.groupId}.activiti.query</invokerPackage>
                  </configOptions>
                </configuration>
              </execution>
              <execution>
                <id>generate-activiti-audit-api</id>
                <goals>
                  <goal>generate</goal>
                </goals>
                <configuration>
                  <inputSpec>${project.build.directory}/activiti-cloud-starter-audit-${activiti-cloud.version}-api-docs.json</inputSpec>
                  <output>${project.build.generatedSourceDirectory}/alfresco-activiti-audit-rest-api</output>
                  <artifactId>alfresco-activiti-audit-rest-api</artifactId>
                  <configOptions>
                    <apiPackage>${project.groupId}.activiti.audit.handler</apiPackage>
                    <modelPackage>${project.groupId}.activiti.audit.model</modelPackage>
                    <invokerPackage>${project.groupId}.activiti.audit</invokerPackage>
                  </configOptions>
                </configuration>
              </execution>
              <execution>
                <id>generate-activiti-runtime-api</id>
                <goals>
                  <goal>generate</goal>
                </goals>
                <configuration>
                  <inputSpec>${project.build.directory}/alfresco-process-runtime-bundle-service-${alfresco-process.version}-api-docs.json</inputSpec>
                  <output>${project.build.generatedSourceDirectory}/alfresco-activiti-runtime-rest-api</output>
                  <artifactId>alfresco-activiti-runtime-rest-api</artifactId>
                  <configOptions>
                    <apiPackage>${project.groupId}.activiti.runtime.handler</apiPackage>
                    <modelPackage>${project.groupId}.activiti.runtime.model</modelPackage>
                    <invokerPackage>${project.groupId}.activiti.runtime</invokerPackage>
                  </configOptions>
                </configuration>
              </execution>
            </executions>
            <inherited>false</inherited>
            <configuration>
              <groupId>${project.groupId}</groupId>
              <artifactVersion>${project.version}</artifactVersion>
              <language>spring</language>
              <library>spring-cloud</library>
              <templateDirectory>${project.build.outputDirectory}/templates</templateDirectory>
              <configOptions>
                <defaultInterfaces>false</defaultInterfaces>
                <hideGenerationTimestamp>true</hideGenerationTimestamp>
                <java8>true</java8>
              </configOptions>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${exec-maven-plugin.version}</version>
            <executions>
              <execution>
                <phase>generate-sources</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>bash</executable>
                  <arguments>
                    <argument>patch.sh</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
            <inherited>false</inherited>
          </plugin>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>add-license-header</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>format</goal>
                </goals>
              </execution>
              <execution>
                <id>validate-license</id>
                <phase>process-sources</phase>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>jdk9+</id>
      <activation>
        <jdk>[9,)</jdk>
      </activation>
      <properties>
        <maven.compiler.release>${java.release}</maven.compiler.release>
      </properties>
    </profile>
  </profiles>
</project>
