<?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.kie.kogito</groupId>
    <artifactId>kogito-examples</artifactId>
    <version>0.3.0</version>
  </parent>
  <groupId>org.kie.kogito.examples</groupId>
  <artifactId>jbpm-springboot-example</artifactId>
  
  <name>jBPM example running on SpringBoot</name>
  <description>Order management service</description>
  
  <properties>
    <java.version>1.8</java.version>
    <cxf.version>3.2.6</cxf.version>
    <springboot.version>2.1.1.RELEASE</springboot.version>
    <javax.activation.version>1.1.1</javax.activation.version>
  </properties>
  
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${springboot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>${version.ch.qos.logback}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter</artifactId>
    </dependency>
    
    <dependency>
      <groupId>com.fasterxml.jackson.jaxrs</groupId>
      <artifactId>jackson-jaxrs-json-provider</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
      <version>${cxf.version}</version>
    </dependency>
    
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>kogito-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>drools-core-static</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>drools-compiler</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>drools-canonical-model</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>drools-model-compiler</artifactId>
    </dependency>
    
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>jbpm-flow</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>process-management-addon</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.activation</groupId>
      <artifactId>activation</artifactId>
      <version>${javax.activation.version}</version>
    </dependency>
    
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.rest-assured</groupId>
      <artifactId>rest-assured</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <build>
    <plugins>
      <plugin>
        <groupId>org.kie.kogito</groupId>
        <artifactId>kogito-maven-plugin</artifactId>
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>${springboot.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>${start-class}</mainClass>
        </configuration>
      </plugin>
      <plugin>
        <groupId>io.openapitools.swagger</groupId>
        <artifactId>swagger-maven-plugin</artifactId>
        <configuration>
          <resourcePackages>
            <resourcePackage>org.kie.kogito.examples</resourcePackage>
          </resourcePackages>
          <outputDirectory>${basedir}/target/classes/static/</outputDirectory>
          <outputFilename>swagger</outputFilename>
          <outputFormats>JSON,YAML</outputFormats>
          <prettyPrint>true</prettyPrint>
          <swaggerConfig>
            <info>
              <title>${project.description}</title>
              <version>${project.version}</version>
            </info>
          </swaggerConfig>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  
  <profiles>
    <profile>
      <id>persistence</id>
      <activation>
        <property>  
          <name>persistence</name>
        </property>
      </activation>
      <dependencies>       
        <dependency>
          <groupId>org.kie.kogito</groupId>
          <artifactId>infinispan-persistence-addon</artifactId>
          <version>${project.version}</version>
        </dependency>
        <dependency>
          <groupId>org.infinispan</groupId>
          <artifactId>infinispan-spring-boot-starter-remote</artifactId>
          <version>2.1.7.Final</version>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
  
</project>