<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2023 Tirasa (info@tirasa.net)

    Licensed under the Apache License, Version 2.0 (the "License");
    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.

-->
<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>Flowable Leftovers</name>
  <description>Brings back components leftover by latest Flowable releases</description>
  <groupId>net.tirasa.flowable-leftovers</groupId>
  <artifactId>flowable-leftovers</artifactId>
  <version>7.0.1</version>
  <packaging>pom</packaging>

  <url>https://github.com/Tirasa/flowable-leftovers</url>
  <inceptionYear>2023</inceptionYear>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:Tirasa/flowable-leftovers.git</connection>
    <url>scm:git:git@github.com:Tirasa/flowable-leftovers.git</url>
    <developerConnection>scm:git:git@github.com:Tirasa/flowable-leftovers.git</developerConnection>
    <tag>flowable-leftovers-7.0.1</tag>
  </scm>

  <issueManagement>
    <system>Github Issue</system>
    <url>https://github.com/Tirasa/flowable-leftovers/issues</url>
  </issueManagement>

  <ciManagement>
    <system>GitHub Workflow</system>
    <url>https://github.com/Tirasa/flowable-leftovers/actions</url>
  </ciManagement>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <developers>
    <developer>
      <id>ilgrosso</id>
      <email>ilgrosso@apache.org</email>
      <name>Francesco Chicchiriccò</name>
      <organization>Tirasa</organization>
      <organizationUrl>http://www.tirasa.net/</organizationUrl>
      <url>https://home.apache.org/~ilgrosso/</url>
    </developer>
  </developers>

  <properties>
    <flowable.version>7.0.1</flowable.version>    

    <targetJdk>17</targetJdk>
    <rootpom.basedir>${basedir}</rootpom.basedir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.flowable</groupId>
        <artifactId>flowable-bpmn-converter</artifactId>
        <version>${flowable.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <defaultGoal>clean verify</defaultGoal>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.12.1</version>
          <configuration>
            <release>${targetJdk}</release>
            <useIncrementalCompilation>false</useIncrementalCompilation>
            <showWarnings>true</showWarnings>
            <showDeprecation>true</showDeprecation>
            <compilerArgument>-Xlint:unchecked</compilerArgument>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.3.1</version>
          <configuration>
            <configLocation>${rootpom.basedir}/src/main/resources/checkstyle.xml</configLocation>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>3.0.1</version>
          <configuration>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <useReleaseProfile>false</useReleaseProfile>
            <arguments>-Psonatype-oss-release</arguments>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    
    <plugins>
      <plugin>
        <groupId>org.gaul</groupId>
        <artifactId>modernizer-maven-plugin</artifactId>
        <version>2.7.0</version>
        <configuration>
          <javaVersion>${targetJdk}</javaVersion>
        </configuration>
        <executions>
          <execution>
            <id>modernizer-check</id>
            <phase>verify</phase>
            <goals>
              <goal>modernizer</goal>
            </goals>
          </execution>
        </executions>
      </plugin>      

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <resourceExcludes>**/LICENSE,**/NOTICE</resourceExcludes>
        </configuration>
        <executions>
          <execution>
            <id>checkstyle-check</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.16</version>
        <configuration>
          <excludes>
            <exclude>nbactions.xml</exclude>
            <exclude>nb-configuration.xml</exclude>
            <exclude>**/META-INF/cxf/**</exclude>
            <exclude>**/META-INF/services/**</exclude>
            <exclude>**/META-INF/MANIFEST.MF</exclude>            
            <exclude>**/*.csv</exclude>
            <exclude>**/archetype-resources/**</exclude>
            <exclude>**/AdminLTE*/**</exclude>
            <exclude>**/goal.txt</exclude>
            <exclude>**/rat.txt</exclude>
            <exclude>**/build-copy-javadoc-files.xml</exclude>
            <exclude>**/maven-eclipse.xml</exclude>
            <exclude>**/*.iml</exclude>
            <exclude>**/*.log</exclude>
            <exclude>**/.externalToolBuilders/**</exclude>
            <exclude>.git/**</exclude>
            <exclude>.idea/**</exclude>
            <exclude>**/.settings/**</exclude>
            <exclude>**/.*</exclude>
            <exclude>**/deb/control/conffiles</exclude>
            <exclude>**/deb/control/control</exclude>
            <exclude>**/*.lst</exclude>
            <exclude>**/*.json</exclude>
            <exclude>**/target/**</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <id>rat-check</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Put NOTICE and LICENSE files in all artifacts and javadocs -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <id>copy-artifact-legal-files</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/classes/META-INF</outputDirectory>
              <resources>
                <resource>
                  <directory>${rootpom.basedir}</directory>
                  <includes>
                    <include>LICENSE</include>
                    <include>NOTICE</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-javadoc-legal-files</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/apidocs/META-INF</outputDirectory>
              <resources>
                <resource>
                  <directory>${rootpom.basedir}</directory>
                  <includes>
                    <include>LICENSE</include>
                    <include>NOTICE</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <mavenExecutorId>forked-path</mavenExecutorId>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <tagNameFormat>flowable-leftovers-@{project.version}</tagNameFormat>
        </configuration>
      </plugin>
    </plugins>

    <resources>
      <resource>
        <directory>.</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>LICENSE</include>
          <include>NOTICE</include>
        </includes>
      </resource>
    </resources>
  </build>

  <profiles>
    <profile>
      <id>sonatype-oss-release</id>

      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.6.3</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>          
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.3.0</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
                <configuration>
                  <includes>
                    <include>${rootpom.basedir}/LICENSE</include>
                    <include>${rootpom.basedir}/NOTICE</include>
                  </includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>    
  </profiles>

  <modules>
    <module>flowable-json-converter</module>
  </modules>
</project>
