<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.camunda</groupId>
    <artifactId>camunda-release-parent</artifactId>
    <version>3.9.1</version>
    <!-- do not remove empty tag - http://jira.codehaus.org/browse/MNG-4687 -->
    <relativePath/>
  </parent>

  <groupId>io.camunda.connector</groupId>
  <artifactId>connector-parent</artifactId>
  <version>0.2.2</version>
  <packaging>pom</packaging>

  <name>Camunda Connector Parent</name>
  <description>${project.name}</description>
  <inceptionYear>2022</inceptionYear>

  <scm>
    <connection>scm:git:git@github.com:camunda/connector-framework.git</connection>
    <developerConnection>scm:git:git@github.com:camunda/connector-framework.git</developerConnection>
    <tag>HEAD</tag>
    <url>https://github.com/camunda/connector-framework</url>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/camunda/connector-framework/issues</url>
  </issueManagement>
  
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <properties>
    <version.java>11</version.java>

    <!-- an inline header will allow usage in downstream connectors -->
    <license.inlineheader>Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information regarding copyright
ownership. Camunda licenses this file to you under the Apache License,
Version 2.0; you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.</license.inlineheader>
    <license.excludedScopes>test,provided</license.excludedScopes>
    <license.fileTemplate>${basedir}/licenses/third-party.ftl</license.fileTemplate>
    <license.outputDirectory>${basedir}</license.outputDirectory>
    <license.thirdPartyFilename>THIRD_PARTY_NOTICES</license.thirdPartyFilename>

    <!-- release parent settings -->
    <nexus.snapshot.repository>https://artifacts.camunda.com/artifactory/connectors-snapshots/</nexus.snapshot.repository>
    <nexus.release.repository>https://artifacts.camunda.com/artifactory/connectors/</nexus.release.repository>
    <nexus.sonatype.url>https://s01.oss.sonatype.org</nexus.sonatype.url>

    <!-- Camunda internal libraries -->
    <version.zeebe>8.0.6</version.zeebe>
    <version.feel-engine>1.15.2</version.feel-engine>

    <!-- Third party dependencies -->
    <version.slf4j>1.7.36</version.slf4j>
    <version.jakarta-validation>3.0.2</version.jakarta-validation>
    <version.gson>2.9.1</version.gson>
    <version.mockito>4.8.0</version.mockito>
    <version.junit-jupiter>5.9.1</version.junit-jupiter>
    <version.assertj>3.23.1</version.assertj>
    <version.jackson-module-scala>2.13.4</version.jackson-module-scala>
    <version.hibernate-validator>8.0.0.Final</version.hibernate-validator>

    <!-- maven plugins (not managed by parent) -->
    <plugin.version.function-maven-plugin>0.10.1</plugin.version.function-maven-plugin>
    <plugin.version.maven-enforcer-plugin>3.1.0</plugin.version.maven-enforcer-plugin>
    <plugin.version.maven-install-plugin>3.0.1</plugin.version.maven-install-plugin>
    <plugin.version.license>4.1</plugin.version.license>
    <plugin.version.license.codehaus>2.0.0</plugin.version.license.codehaus>
    <plugin.version.maven-resources-plugin>3.2.0</plugin.version.maven-resources-plugin>
    <plugin.version.maven-shade-plugin>3.4.0</plugin.version.maven-shade-plugin>
    <plugin.version.maven-surefire-plugin>3.0.0-M7</plugin.version.maven-surefire-plugin>
    <plugin.version.spotless-maven-plugin>2.27.0</plugin.version.spotless-maven-plugin>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- Camunda internal dependencies -->
      <dependency>
        <groupId>io.camunda.connector</groupId>
        <artifactId>connector-core</artifactId>
        <version>0.2.2</version>
      </dependency>

      <dependency>
        <groupId>io.camunda.connector</groupId>
        <artifactId>connector-validation</artifactId>
        <version>0.2.2</version>
      </dependency>

      <dependency>
        <groupId>io.camunda</groupId>
        <artifactId>zeebe-client-java</artifactId>
        <version>${version.zeebe}</version>
      </dependency>

      <dependency>
        <groupId>org.camunda.feel</groupId>
        <artifactId>feel-engine</artifactId>
        <version>${version.feel-engine}</version>
      </dependency>
      
      <!-- Third party dependencies -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${version.slf4j}</version>
      </dependency>
      
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>${version.slf4j}</version>
      </dependency>

      <dependency>
        <groupId>jakarta.validation</groupId>
        <artifactId>jakarta.validation-api</artifactId>
        <version>${version.jakarta-validation}</version>
      </dependency>

      <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>${version.gson}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-scala_2.13</artifactId>
        <version>${version.jackson-module-scala}</version>
      </dependency>

      <dependency>
        <groupId>org.hibernate.validator</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>${version.hibernate-validator}</version>
      </dependency>

      <!-- test dependencies -->
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>${version.junit-jupiter}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${version.mockito}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-junit-jupiter</artifactId>
        <version>${version.mockito}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${version.assertj}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>${plugin.version.maven-install-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>${plugin.version.maven-shade-plugin}</version>
          <configuration>
            <shadedArtifactAttached>true</shadedArtifactAttached>
            <shadedClassifierName>with-dependencies</shadedClassifierName>
            <!-- no need for this since we are not consuming this artifact downstream -->
            <createDependencyReducedPom>false</createDependencyReducedPom>
            <artifactSet>
              <excludes>
                <!-- Classes provided by JSR-250 artifact are fully covered by javax.annotation-api artifact
                     that comes with google-cloud-secretmanager (dependency of connector-runtime-cloud) -->
                <exclude>javax.annotation:jsr250-api</exclude>
              </excludes>
            </artifactSet>
            <filters>
              <filter>
                <artifact>*:*</artifact>
                <excludes>
                  <exclude>module-info.class</exclude>
                  <exclude>META-INF/versions/9/module-info.class</exclude>
                  <exclude>META-INF/DEPENDENCIES</exclude>
                  <exclude>META-INF/*.SF</exclude>
                  <exclude>META-INF/*.DSA</exclude>
                  <exclude>META-INF/*.RSA</exclude>
                </excludes>
              </filter>
            </filters>
            <transformers>
              <!-- This is needed if you have dependencies that use Service Loader. Most Google Cloud client libraries does. -->
              <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
              <!-- This is needed to not repeat licenses in the META-INF directory -->
              <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
              <!-- This is needed to merge existing NOTICE files and keep them downstream -->
              <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
                <addHeader>false</addHeader>
              </transformer>
            </transformers>
          </configuration>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>shade</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${plugin.version.maven-surefire-plugin}</version>
          <configuration>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${plugin.version.maven-enforcer-plugin}</version>
          <configuration>
            <rules>
              <!--
                <dependencyConvergence />
              -->
              <requirePluginVersion/>
            </rules>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>enforce</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>${plugin.version.spotless-maven-plugin}</version>
          <configuration>
            <formats>
              <format>
                <includes>
                  <include>*.md</include>
                  <include>.gitignore</include>
                </includes>
                <trimTrailingWhitespace/>
                <endWithNewline/>
                <indent>
                  <spaces>true</spaces>
                  <spacesPerTab>2</spacesPerTab>
                </indent>
              </format>
            </formats>
            <java>
              <googleJavaFormat/>
            </java>
            <pom/>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${plugin.version.license}</version>
          <configuration>
            <properties>
              <owner>camunda services GmbH</owner>
              <email>info@camunda.com</email>
            </properties>
            <mapping>
              <java>SLASHSTAR_STYLE</java>
            </mapping>
            <skipExistingHeaders>false</skipExistingHeaders>
            <licenseSets>
              <licenseSet>
                <inlineHeader>${license.inlineheader}</inlineHeader>
                <includes>
                  <include>**/*.java</include>
                </includes>
              </licenseSet>
            </licenseSets>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${plugin.version.license.codehaus}</version>
          <configuration>
            <licenseMerges>
              <licenseMerge>Apache-2.0|Apache License 2.0|Apache License, Version 2.0|The Apache Software License, Version 2.0|Apache 2.0|Apache License, version 2.0|The Apache License, Version 2.0|Apache 2</licenseMerge>
              <licenseMerge>MIT|MIT License|The MIT License|MIT license|The MIT License (MIT)</licenseMerge>
              <licenseMerge>BSD-3-Clause|3-Clause BSD License|BSD|BSD New license</licenseMerge>
              <licenseMerge>EPL-2.0|Eclipse Public License v. 2.0</licenseMerge>
              <licenseMerge>GPLv2 with Classpath Exception|GNU General Public License, version 2 with the GNU Classpath Exception</licenseMerge>
              <licenseMerge>CDDLv1.0|COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0</licenseMerge>
              <licenseMerge>Bouncy Castle|Bouncy Castle Licence</licenseMerge>
            </licenseMerges>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.google.cloud.functions</groupId>
          <artifactId>function-maven-plugin</artifactId>
          <version>${plugin.version.function-maven-plugin}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- profile to auto format -->
    <profile>
      <id>autoFormat</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.diffplug.spotless</groupId>
            <artifactId>spotless-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>spotless-format</id>
                <goals>
                  <goal>apply</goal>
                </goals>
                <phase>process-sources</phase>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>add-license</id>
                <goals>
                  <goal>format</goal>
                </goals>
                <phase>process-sources</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- profile to perform strict validation checks -->
    <profile>
      <id>checkFormat</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.diffplug.spotless</groupId>
            <artifactId>spotless-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>spotless-check</id>
                <goals>
                  <goal>check</goal>
                </goals>
                <phase>validate</phase>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>check-license</id>
                <goals>
                  <goal>check</goal>
                </goals>
                <phase>validate</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>sonatype-oss-release</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-gpg-plugin</artifactId>
              <configuration>
                <gpgArguments>
                  <arg>--pinentry-mode</arg>
                  <arg>loopback</arg>
                </gpgArguments>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>

</project>
