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

  <!-- 
    This starter cannot be a child of the camunda-parent due to the Spring dependencies defined there in
    the dependencyManagement section. The starter needs to work with the Spring dependency versions defined
    in the spring-boot-dependencies artifact which would be overriden by the versions defined in the camunda-parent.
  -->
  <parent>
    <groupId>org.camunda.bpm</groupId>
    <artifactId>camunda-root</artifactId>
    <version>7.13.0</version>
  </parent>

  <groupId>org.camunda.bpm.springboot.project</groupId>
  <artifactId>camunda-bpm-spring-boot-starter-root</artifactId>
  <name>camunda BPM - Spring Boot Starter - Root Pom</name>
  <inceptionYear>2015</inceptionYear>

  <packaging>pom</packaging>

  <modules>
    <module>starter</module>
    <module>starter-rest</module>
    <module>starter-webapp-core</module>
    <module>starter-webapp</module>
    <module>starter-test</module>
  </modules>

  <properties>
    <!-- disable javadoc linter for JDK8 to not fail on incomplete javadoc -->
    <additionalparam>-Xdoclint:none</additionalparam>

    <license.includeTransitiveDependencies>false</license.includeTransitiveDependencies>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <!-- Import dependency management from camunda -->
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-bom</artifactId>
        <version>${project.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>

      <dependency>
        <!-- Import dependency management from Spring Boot -->
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${version.spring-boot}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>

      <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.2.4</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.8.1</version>
      </dependency>

    </dependencies>
  </dependencyManagement>
  
  <profiles>
    <profile>
      <id>license-header-check</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>distro</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <modules>
        <module>starter-qa</module>
      </modules>
    </profile>
    <profile>
      <id>integration-test-spring-boot-starter</id>
      <modules>
        <module>starter-qa</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <defaultGoal>clean install</defaultGoal>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries />
              </manifest>
            </archive>
          </configuration>
        </plugin>
        <!-- set version for spring-boot-maven-plugin because we use the
          spring-boot-parent only in dependencyManagement section, not as parent. -->
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${version.spring-boot}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
          <configuration>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
            <trimStackTrace>false</trimStackTrace>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.22.2</version>
          <configuration>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
            <trimStackTrace>false</trimStackTrace>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M1</version>
        <configuration>
          <rules>
            <requireJavaVersion>
              <version>[1.8,)</version>
            </requireJavaVersion>
          </rules>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>enforce</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>1.14</version>
        <configuration>
          <acceptPomPackaging>true</acceptPomPackaging>
          <excludedScopes>test</excludedScopes>
        </configuration>
      </plugin>

    </plugins>
  </build>

</project>
