<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>

  <name>Activiti - Rest</name>
  <artifactId>activiti-webapp-rest2</artifactId>
  <packaging>war</packaging>

  <parent>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-root</artifactId>
    <relativePath>../..</relativePath>
    <version>6.0.0</version>
  </parent>
  
  <!-- swagger config -->
   <properties>
    <swagger.host>localhost:8080</swagger.host>
    <swagger.generated.directory>target/generated-swagger</swagger.generated.directory>
  </properties>
  <!-- swagger config end-->
  
  <build>
    <plugins>
      <plugin>
        <groupId>org.zeroturnaround</groupId>
        <artifactId>jrebel-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-rebel-xml</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
	    <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
		<configuration>
		  <port>8080</port>
		  <path>/activiti-rest</path>
		  <systemProperties>
		    <com.sun.management.jmxremote.port>4000</com.sun.management.jmxremote.port>
          </systemProperties>
		</configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>
                      org.zeroturnaround
                    </groupId>
                    <artifactId>
                      jrebel-maven-plugin
                    </artifactId>
                    <versionRange>
                      [1.0.7,)
                    </versionRange>
                    <goals>
                      <goal>generate</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
	  <id>buildExecutableWar</id>
	    <build>
		  <plugins>
            <plugin>
              <groupId>org.apache.tomcat.maven</groupId>
			  <artifactId>tomcat7-maven-plugin</artifactId>
			  <version>2.1</version>
			  <configuration>
			    <path>/</path>
			  </configuration>
			  <executions>
			    <execution>
				  <id>tomcat-run</id>
				  <goals>
				    <goal>exec-war-only</goal>
				  </goals>
				  <phase>package</phase>
				  <configuration>
                    <path>/activiti-rest</path>
                  </configuration>
				</execution>
			  </executions>
			</plugin>
		  </plugins>
	  </build>
    </profile>
    
    
    <!-- swagger profile config -->
    <profile>
      <id>swagger</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.kongchen</groupId>
            <artifactId>swagger-maven-plugin</artifactId>
            <version>3.1.4</version>
            <configuration>
              <apiSources>
                <apiSource>
                  <springmvc>true</springmvc>
                  <locations>
                    <location>org.activiti.rest.service.api</location>
                  </locations>
                  <schemes>
                    <scheme>http</scheme>
                    <scheme>https</scheme>
                  </schemes>
                  <host>${swagger.host}</host>
                  <basePath>/activiti-rest/service</basePath>
                  <info>
                    <title>Activiti REST API</title>
                    <version>v1</version>
                    <contact>
                      <email></email>
                      <name>Activiti</name>
                      <url>http://www.activiti.org/</url>
                    </contact>
                    <license>
                      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
                      <name>Apache 2.0</name>
                    </license>
                  </info>
                  <securityDefinitions>
                    <securityDefinition>
                      <name>basicAuth</name>
                      <type>basic</type>
                    </securityDefinition>
                  </securityDefinitions>
                  <descriptionFile>${basedir}/src/main/resources/swagger/info.txt</descriptionFile>
                  <outputFormats>json,yaml</outputFormats>
                  <swaggerFileName>activiti</swaggerFileName>
                  <swaggerDirectory>${basedir}/src/main/webapp/docs</swaggerDirectory>
                </apiSource>
                
              </apiSources>
            </configuration>
            <executions>
              <execution>
                <phase>compile</phase>
                <goals>
                  <goal>generate</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!-- swagger profile config end-->
    
  </profiles>
  
  <dependencies>
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-engine</artifactId>
    </dependency>
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-spring</artifactId>
    </dependency>
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-rest</artifactId>
    </dependency>
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-json-converter</artifactId>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
    </dependency>
    <dependency>
      <groupId>com.zaxxer</groupId>
      <artifactId>HikariCP</artifactId>
      <version>2.4.6</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>
