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

  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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>

  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>21</version>
  </parent>

  <groupId>org.apache.plc4x</groupId>
  <artifactId>plc4x-parent</artifactId>
  <version>0.2.0</version>
  <packaging>pom</packaging>

  <name>PLC4X</name>
  <description>
    PLC4X is an effort to create a universal library for accessing industrial programmable logic controllers
    using a variety of protocols using a uniform API.
  </description>
  <url>https://plc4x.apache.org</url>
  <inceptionYear>2017</inceptionYear>

  <scm>
    <connection>scm:git:https://gitbox.apache.org/repos/asf/incubator-plc4x.git</connection>
    <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/incubator-plc4x.git</developerConnection>
    <url>https://github.com/apache/incubator-plc4x</url>
    <tag>release/0.2.0</tag>
  </scm>

  <!-- Only configure the site distribution as the rest is handled by the apache parent -->
  <distributionManagement>
    <site>
      <id>apache.website</id>
      <url>scm:git:https://gitbox.apache.org/repos/asf/incubator-plc4x.git</url>
    </site>
  </distributionManagement>

  <issueManagement>
    <system>Jira</system>
    <url>https://issues.apache.org/jira/browse/PLC4X</url>
  </issueManagement>

  <mailingLists>
    <mailingList>
      <name>Apache PLC4X Developer List</name>
      <subscribe>dev-subscribe@plc4x.apache.org</subscribe>
      <unsubscribe>dev-unsubscribe@plc4x.apache.org</unsubscribe>
      <post>dev@plc4x.apache.org</post>
      <archive>http://mail-archives.apache.org/mod_mbox/plc4x-dev/</archive>
    </mailingList>
  </mailingLists>

  <properties>
    <!--
      3.0.5 would have been enough, but special plugins require newer Maven versions:
      At least 3.2 required for jqassistant-maven-plugin
      At least 3.3.3 required for camel-package-maven-plugin
    -->
    <maven.version>3.3.3</maven.version>

    <java.version>1.8</java.version>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputencoding>UTF-8</project.reporting.outputencoding>

    <!-- URL of the ASF SonarQube server -->
    <sonar.host.url>https://builds.apache.org/analysis</sonar.host.url>
    <!-- Exclude all generated code -->
    <sonar.exclusions>**/generated-sources</sonar.exclusions>

    <assertj.version>3.11.1</assertj.version>
    <commons-io.version>2.6</commons-io.version>
    <commons-codec.version>1.11</commons-codec.version>
    <commons-collections4.version>4.1</commons-collections4.version>
    <commons-lang.version>2.6</commons-lang.version>
    <groovy.version>2.5.3</groovy.version>
    <gson.version>2.8.0</gson.version>
    <hamcrest.version>1.3</hamcrest.version>
    <junit.version>4.12</junit.version>
    <junit.jupiter.version>5.2.0</junit.jupiter.version>
    <junit.platform.version>1.2.0</junit.platform.version>
    <logback.version>1.2.3</logback.version>
    <mockito.version>2.22.0</mockito.version>
    <netty.version>4.1.23.Final</netty.version>
    <pcap4j.version>1.7.3</pcap4j.version>
    <slf4j.version>1.7.25</slf4j.version>
    <spock.version>1.2-groovy-2.5</spock.version>

    <!-- Site properties -->
    <bootstrap.version>3.3.7</bootstrap.version>
    <jquery.version>3.3.1</jquery.version>
    <anchorjs.version>3.2.2</anchorjs.version>
    <fontawesome.version>5.2.0</fontawesome.version>
  </properties>

  <modules>
    <!-- Core PLC4X modules -->
    <module>plc4c</module>
    <module>plc4j</module>
    <module>plc4s</module>

    <!-- Integration modules for other frameworks -->
    <module>integrations</module>

    <!-- Examples -->
    <module>examples</module>
  </modules>

  <prerequisites>
    <maven>${maven.version}</maven>
  </prerequisites>

  <dependencyManagement>
    <dependencies>
      <!--
        Set to provided to ensure that these jars are never automatically
        included. If required the used still can override it if it is needed. -->
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>${logback.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>${gson.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${commons-io.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
        <version>${commons-collections4.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>${commons-codec.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-buffer</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-codec</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-codec-http</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-common</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-handler</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-resolver</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-transport</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-transport-rxtx</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>${junit.jupiter.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-params</artifactId>
        <version>${junit.jupiter.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit.jupiter.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.vintage</groupId>
        <artifactId>junit-vintage-engine</artifactId>
        <version>${junit.jupiter.version}</version>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>${hamcrest.version}</version>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>${hamcrest.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-junit-jupiter</artifactId>
        <version>${mockito.version}</version>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${assertj.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.7</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-configuration2</artifactId>
        <version>2.2</version>
      </dependency>
      <dependency>
        <groupId>org.pcap4j</groupId>
        <artifactId>pcap4j-core</artifactId>
        <version>${pcap4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.pcap4j</groupId>
        <artifactId>pcap4j-packetfactory-static</artifactId>
        <version>${pcap4j.version}</version>
      </dependency>

      <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-test-junit5</artifactId>
        <version>${groovy.version}</version>
        <!-- Ensure we only use this in test -->
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.spockframework</groupId>
        <artifactId>spock-core</artifactId>
        <version>${spock.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <!-- As some plugins require a minimum version of maven, check that this requirement is meet. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M1</version> <!--$NO-MVN-MAN-VER$-->
        <executions>
          <!-- Make sure no dependencies are used for which known vulnerabilities exist. -->
          <execution>
            <id>vulnerability-checks</id>
            <phase>validate</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>1.8.0</version>
                </requireJavaVersion>
                <!-- Disabled for now as it breaks the ability to build single modules -->
                <!--reactorModuleConvergence/-->
                <banVulnerable implementation="org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies" />
              </rules>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.sonatype.ossindex.maven</groupId>
            <artifactId>ossindex-maven-enforcer-rules</artifactId>
            <version>1.0.0</version>
          </dependency>
        </dependencies>
      </plugin>

      <!-- Plugin for analysing the project based on neo4j queries -->
      <plugin>
        <groupId>com.buschmais.jqassistant</groupId>
        <artifactId>jqassistant-maven-plugin</artifactId>
        <version>1.5.0</version>
        <executions>
          <execution>
            <goals>
              <goal>scan</goal>
              <goal>analyze</goal>
            </goals>
            <configuration>
              <rulesDirectory>${project.basedir}/src/jqassistant</rulesDirectory>
              <failOnSeverity>MAJOR</failOnSeverity>
              <warnOnSeverity>MINOR</warnOnSeverity>
              <scanIncludes>
                <scanInclude>
                  <path>${project.basedir}/.git</path>
                </scanInclude>
              </scanIncludes>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Check if all source files have the required apache license headers -->
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <executions>
          <execution>
            <id>license-check</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <!-- Git related files -->
            <exclude>**/.git/**</exclude>
            <exclude>**/.gitignore</exclude>

            <!-- Maven related files -->
            <exclude>**/target/**</exclude>

            <!-- Eclipse related files -->
            <exclude>**/.project</exclude>
            <exclude>**/.settings/**</exclude>
            <exclude>**/.classpath</exclude>

            <!-- IntelliJ related files -->
            <exclude>**/.idea/**</exclude>
            <exclude>**/*.iml</exclude>

            <!-- Wireshark Captures -->
            <exclude>**/*.pcapng</exclude>

            <!-- Asciidoctor generated files -->
            <exclude>**/.asciidoctor/**</exclude>

            <!-- Jenkins build related files -->
            <exclude>.repository/**</exclude>

            <!-- Data files created by examples running an embedded elasticsearch -->
            <exclude>elasticsearch-data/**</exclude>
          </excludes>
        </configuration>
      </plugin>

      <!-- Generate the legally required text files in the jars -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-remote-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>process-resource-bundles</id>
            <goals>
              <goal>process</goal>
            </goals>
            <configuration>
              <resourceBundles>
                <!-- Will generate META-INF/{DEPENDENCIES,LICENSE,NOTICE} -->
                <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
                <!-- Will generate META-INF/DISCLAIMER  -->
                <resourceBundle>org.apache:apache-incubator-disclaimer-resource-bundle:1.1</resourceBundle>
              </resourceBundles>
              <!-- Content in this directory will be appended to generated resources -->
              <appendedResourcesDirectory>${basedir}/src/remote-resources</appendedResourcesDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Compile any groovy code located in "src/test/groovy" -->
      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <version>1.6.2</version>
        <executions>
          <execution>
            <id>compile-groovy-tests</id>
            <phase>test-compile</phase>
            <goals>
              <goal>addTestSources</goal>
              <goal>compileTests</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!--
        ===================================
        ==                               ==
        ==    SITE GENERATION PLUGINS    ==
        ==                               ==
        ===================================

        Starting here the following plugins are used for generating the projects website.

        Most of the complexity is due to the fact that we selected "localResouces" in the site.xml
        This causes the generated output not to rely on external resources. Therefore we have to
        manually take care of fetching and packaging these external resources with the generated site.
      -->

      <!--
          The reflow maven skin used for the site-generation requires some static resources.
          The following plugins configure the acquisition and location of these resources.
      -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-js-deps</id>
            <phase>pre-site</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <!--
                  Bundle these dependencies in the war.

                  You must maintain the corresponding info if you
                  add/remove artifacts or change their versions:
                    - entry in src/main/webapp/META-INF/LICENSE
                    - entry in src/main/webapp/META-INF/NOTICE when appropriate

                  You must maintain the info in the corresponding
                  console/server files because it bundles this war.

                  You must maintain the info in this project's
                  corresponding platforms/java7 files.
               -->
              <artifactItems>
                <artifactItem>
                  <groupId>org.webjars</groupId>
                  <artifactId>bootstrap</artifactId>
                  <version>${bootstrap.version}</version>
                  <!-- We're replacing this by in the get-flatly-bootstrap-theme execution a few lines down -->
                  <excludes>META-INF/resources/webjars/**/bootstrap.min.css</excludes>
                </artifactItem>
                <artifactItem>
                  <groupId>org.webjars</groupId>
                  <artifactId>jquery</artifactId>
                  <version>${jquery.version}</version>
                </artifactItem>
                <artifactItem>
                  <groupId>org.webjars</groupId>
                  <artifactId>anchorjs</artifactId>
                  <version>${anchorjs.version}</version>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!--
        Replace the bootstrap css with the version of the theme
      -->
      <plugin>
        <groupId>com.googlecode.maven-download-plugin</groupId>
        <artifactId>download-maven-plugin</artifactId>
        <version>1.4.0</version>
        <executions>
          <execution>
            <id>get-flatly-bootstrap-theme</id>
            <phase>pre-site</phase>
            <goals>
              <goal>wget</goal>
            </goals>
            <configuration>
              <url>https://stackpath.bootstrapcdn.com/bootswatch/${bootstrap.version}/flatly/bootstrap.min.css</url>
              <outputDirectory>${project.build.directory}/dependency/META-INF/resources/webjars/bootstrap/${bootstrap.version}/css/</outputDirectory>
              <outputFileName>bootstrap.min.css</outputFileName>
            </configuration>
          </execution>
          <execution>
            <id>get-fontawesome</id>
            <phase>pre-site</phase>
            <goals>
              <goal>wget</goal>
            </goals>
            <configuration>
              <url>https://use.fontawesome.com/releases/v${fontawesome.version}/fontawesome-free-${fontawesome.version}-web.zip</url>
              <unpack>true</unpack>
              <outputDirectory>${project.build.directory}/dependency/fontawesome</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-site-resources</id>
            <phase>pre-site</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/site</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/dependency/META-INF/resources/webjars/anchorjs/${anchorjs.version}</directory>
                  <targetPath>${project.build.directory}/site/js</targetPath>
                  <includes>
                    <include>anchor.min.js</include>
                  </includes>
                </resource>
                <resource>
                  <directory>${project.build.directory}/dependency/META-INF/resources/webjars/bootstrap/${bootstrap.version}</directory>
                  <includes>
                    <include>css/bootstrap.min.css</include>
                    <include>js/bootstrap.min.js</include>
                    <include>fonts/**</include>
                  </includes>
                </resource>
                <resource>
                  <directory>${project.build.directory}/dependency/fontawesome/fontawesome-free-${fontawesome.version}-web</directory>
                  <includes>
                    <include>css/all.min.css</include>
                  </includes>
                </resource>
                <resource>
                  <directory>${project.build.directory}/dependency/fontawesome/fontawesome-free-${fontawesome.version}-web/webfonts</directory>
                  <targetPath>${project.build.directory}/site/fonts</targetPath>
                </resource>
                <resource>
                  <directory>${project.build.directory}/dependency/META-INF/resources/webjars/jquery/${jquery.version}</directory>
                  <targetPath>${project.build.directory}/site/js</targetPath>
                  <includes>
                    <include>jquery.min.js</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!--
        The bootstrap uses "fonts" as directory for locating fonts and fontawesome uses "webfonts".
        This plugin updates the css to also use "fonts".
      -->
      <plugin>
        <groupId>com.google.code.maven-replacer-plugin</groupId>
        <artifactId>replacer</artifactId>
        <version>1.5.3</version>
        <executions>
          <execution>
            <id>streamline-font-urls</id>
            <phase>pre-site</phase>
            <goals>
              <goal>replace</goal>
            </goals>
            <configuration>
              <file>${project.build.directory}/site/css/all.min.css</file>
              <replacements>
                <replacement>
                  <token>../webfonts/</token>
                  <value>../fonts/</value>
                </replacement>
              </replacements>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!--
        When running asciidoctor as part of the site-generation there were great problems with
        the configuration of the diagram generation. Unfortunatel when generating all content here,
        the output will not have the site style. That's why here we generate the images to the
        site directory and have the output written to an outside directory, so it will not interfere.
      -->
      <plugin>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctor-maven-plugin</artifactId>
        <version>1.5.6</version>
        <executions>
          <execution>
            <id>generate-asciidoc</id>
            <phase>site</phase>
            <goals>
              <goal>process-asciidoc</goal>
            </goals>
            <configuration>
              <sourceDirectory>src/site/asciidoc</sourceDirectory>
              <outputDirectory>${project.build.directory}/dump</outputDirectory>
              <attributes>
                <source-highlighter>prettify</source-highlighter>
                <!-- Tells asciidoctor where to put the generated files -->
                <imagesoutdir>${project.build.directory}/site/img</imagesoutdir>
              </attributes>
              <requires>
                <require>asciidoctor-diagram</require>
              </requires>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.jruby</groupId>
            <artifactId>jruby-complete</artifactId>
            <version>9.1.13.0</version>
          </dependency>
          <dependency>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctorj</artifactId>
            <version>1.5.6</version>
          </dependency>
          <dependency>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctorj-diagram</artifactId>
            <version>1.5.4.1</version>
          </dependency>
        </dependencies>
      </plugin>

      <!--
        Make the maven-site-plugin stage the output in the "asf-site" branch
      -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-publish-plugin</artifactId>
        <configuration>
          <!-- mono-module doesn't require site:stage -->
          <content>${project.build.directory}/staging</content>
          <!-- branch where to deploy -->
          <scmBranch>asf-site</scmBranch>
        </configuration>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <configuration>
            <!--
                Make rat output the files with missing licensed directly into the
                build output (This way we don't have to look into the rat.txt to find
                out which ones)
            -->
            <consoleOutput>true</consoleOutput>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.8.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
            <testSource>${java.version}</testSource>
            <testTarget>${java.version}</testTarget>
          </configuration>
        </plugin>

        <!--plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <dependencies>
            <!- Try to get rid of out of heap errors on travis. ->
            <dependency>
              <groupId>org.codehaus.plexus</groupId>
              <artifactId>plexus-archiver</artifactId>
              <version>3.3</version>
            </dependency>
          </dependencies>
        </plugin-->

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <executions>
            <execution>
              <id>attach-sources</id>
              <phase>verify</phase>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <!--
          Inject the "incubating" into the output filename
          N.B. this finalName config spec is currently ignored/overridden
          by the "apache-release" profile based configuration
          in this pom. See that config for the finalName.
          Retain this for now in case we get to the point where
          that "apache-release" config is no longer needed.
        -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.1.0</version>
          <configuration>
            <finalName>apache-plc4x-incubating-${project.version}</finalName>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>3.5.0.1254</version>
        </plugin>

        <!-- Configure the Site generation -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <configuration>
            <!--templateFile>${session.executionRootDirectory}/src/site/template/site.vm</templateFile-->
            <generateReports>true</generateReports>
            <generateSitemap>true</generateSitemap>
            <relativizeDecorationLinks>false</relativizeDecorationLinks>
            <locales>en</locales>
            <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
            <outputEncoding>${project.reporting.outputencoding}</outputEncoding>
            <!--
              IntelliJ can't find the asciidoc config option in the site plugin, which is correct.
              However this config section is used by the asciidoctor site plugin extension. So plead
              ignore this error, it's actually ok.
            -->
            <asciidoc>
              <attributes>
                <source-highlighter>prettify</source-highlighter>
                <!--
                  When running asciidoctor as part of the site-generation, it will generate the diagrams of
                  sub-modules into the root modules img directory, which will break everything. Therefore we
                  tell it to generate to some outside directory and have a second execution of asciidoctor
                  generate the images to the correct location. This is a hack that should be removed as soon
                  as possible.
                -->
                <imagesoutdir>${project.build.directory}/dump</imagesoutdir>
              </attributes>
              <requires>
                <require>asciidoctor-diagram</require>
              </requires>
            </asciidoc>
          </configuration>
          <dependencies>
            <!-- All dependencies needed by the reflow skin -->
            <dependency>
              <groupId>io.github.devacfr.maven.skins</groupId>
              <artifactId>reflow-velocity-tools</artifactId>
              <version>1.3.10</version>
            </dependency>
            <!-- add support for scm/git site deployment -->
            <dependency>
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-scm</artifactId>
              <version>2.12</version>
            </dependency>
            <dependency>
              <groupId>org.apache.maven.scm</groupId>
              <artifactId>maven-scm-api</artifactId>
              <version>1.9.5</version>
            </dependency>
            <dependency>
              <groupId>org.apache.maven.scm</groupId>
              <artifactId>maven-scm-manager-plexus</artifactId>
              <version>1.9.5</version>
            </dependency>
            <dependency>
              <groupId>org.apache.maven.scm</groupId>
              <artifactId>maven-scm-provider-gitexe</artifactId>
              <version>1.9.5</version>
            </dependency>
            <!-- Add support for asciidoctor -->
            <dependency>
              <groupId>org.asciidoctor</groupId>
              <artifactId>asciidoctor-maven-plugin</artifactId>
              <version>1.5.6</version>
            </dependency>
            <dependency>
              <groupId>org.jruby</groupId>
              <artifactId>jruby-complete</artifactId>
              <version>9.1.13.0</version>
            </dependency>
            <dependency>
              <groupId>org.asciidoctor</groupId>
              <artifactId>asciidoctorj</artifactId>
              <version>1.5.6</version>
            </dependency>
            <dependency>
              <groupId>org.asciidoctor</groupId>
              <artifactId>asciidoctorj-diagram</artifactId>
              <version>1.5.4.1</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <!--
              This will suppress the generation of a hidden timestamp at the top of each generated html page
              and hopefully let the site generation nod to too big updates every time.
            -->
            <notimestamp>true</notimestamp>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-changelog-plugin</artifactId>
          <version>2.3</version>
        </plugin>

        <!--                                                                                                                                                                  
              This is a fake plugin which is used to tell m2e (Eclipse) how                                                                                                   
              to process this maven project.                                                                                                                                  
        -->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-remote-resources-plugin</artifactId>
                    <versionRange>[1.0.0,)</versionRange>
                    <goals>
                      <goal>process</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>

      </plugins>
    </pluginManagement>
  </build>

  <reporting>
    <plugins>
      <!-- Generate the unit- and integration-test reports -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>report-only</report>
              <report>failsafe-report-only</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <!-- Generate a code coverage report -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>report</report>
              <report>report-integration</report>
            </reports>
          </reportSet>
          <reportSet>
            <id>aggregate</id>
            <inherited>false</inherited>
            <reports>
              <report>report-aggregate</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <!-- Add html friendly version of source files with line-numbers -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>2.5</version>
      </plugin>

      <!-- Generate javadoc documentation -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>javadoc-no-fork</report>
              <report>test-javadoc-no-fork</report>
            </reports>
          </reportSet>
        </reportSets>
        <configuration>
          <failOnError>true</failOnError>
        </configuration>
      </plugin>

      <!-- Generates a changelog report from GIT commits -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-changelog-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>changelog</report>
              <report>file-activity</report>
            </reports>
          </reportSet>
        </reportSets>
        <configuration>
          <!-- Automatically link Jira issues -->
          <issueLinkUrl>https://issues.apache.org/jira/browse/%ISSUE%</issueLinkUrl>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.buschmais.jqassistant</groupId>
        <artifactId>jqassistant-maven-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>debug-pom</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-help-plugin</artifactId>
            <executions>
              <execution>
                <id>generate-effective-pom</id>
                <phase>compile</phase>
                <goals>
                  <goal>effective-pom</goal>
                </goals>
                <configuration>
                  <output>${project.build.directory}/effective.pom</output>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>jenkins-build</id>
      <properties>
      </properties>
    </profile>

    <!--
      This profile has java-specific plugin configurations
      that might not apply to other languages.
    -->
    <profile>
      <id>java-module</id>
      <activation>
        <file>
          <exists>src/main/java</exists>
        </file>
      </activation>

      <!-- Dependencies common to all java modules -->
      <dependencies>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-classic</artifactId>
          <scope>test</scope>
        </dependency>

        <!-- JUnit 4 Support -->
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <scope>test</scope>
        </dependency>
        <!-- JUnit 5 Support -->
        <dependency>
          <groupId>org.junit.jupiter</groupId>
          <artifactId>junit-jupiter-api</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.junit.jupiter</groupId>
          <artifactId>junit-jupiter-params</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.junit.jupiter</groupId>
          <artifactId>junit-jupiter-engine</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.junit.vintage</groupId>
          <artifactId>junit-vintage-engine</artifactId>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-core</artifactId>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-library</artifactId>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>org.mockito</groupId>
          <artifactId>mockito-core</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.mockito</groupId>
          <artifactId>mockito-junit-jupiter</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.assertj</groupId>
          <artifactId>assertj-core</artifactId>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>groovy-test-junit5</artifactId>
          <version>2.5.3</version>
          <scope>test</scope>
        </dependency>
      </dependencies>

      <build>
        <plugins>
          <!--
            Even if Maven transitively pulls in dependencies, relying on these can
            quite often cause hard to find problems. So it's a good practice to make
            sure everything directly required is also directly added as a dependency.
            On the other side adding unused dependency only over-complicates the
            the dependency graph, so the maven-dependency-plugin checks we depend on
            what we need and only that and that runtime dependencies are correctly
            imported with runtime scope.
          -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>check-dependencies</id>
                <phase>verify</phase>
                <goals>
                  <goal>analyze-only</goal>
                </goals>
                <configuration>
                  <failOnWarning>true</failOnWarning>
                  <ignoredDependencies>
                    <ignoredDependency>org.assertj:assertj-core</ignoredDependency>
                    <ignoredDependency>junit:junit</ignoredDependency>
                    <ignoredDependency>org.junit.jupiter:junit-jupiter-api</ignoredDependency>
                    <ignoredDependency>org.junit.jupiter:junit-jupiter-params</ignoredDependency>
                    <ignoredDependency>org.junit.jupiter:junit-jupiter-engine</ignoredDependency>
                    <ignoredDependency>org.junit.vintage:junit-vintage-engine</ignoredDependency>
                    <ignoredDependency>org.hamcrest:hamcrest-core</ignoredDependency>
                    <ignoredDependency>org.hamcrest:hamcrest-library</ignoredDependency>
                    <ignoredDependency>org.mockito:mockito-core</ignoredDependency>
                    <ignoredDependency>org.mockito:mockito-junit-jupiter</ignoredDependency>
                    <ignoredDependency>org.slf4j:slf4j-api</ignoredDependency>
                    <ignoredDependency>ch.qos.logback:logback-classic</ignoredDependency>
                    <ignoredDependency>org.codehaus.groovy:groovy-test-junit5</ignoredDependency>
                    <ignoredDependency>org.codehaus.groovy:groovy</ignoredDependency>
                    <ignoredDependency>com.athaydes:spock-reports</ignoredDependency>
                  </ignoredDependencies>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <!--
            This plugin doesn't really do much, it makes sure the jacoco agent
            is downloaded and that the path to this is saved in an environment
            variable so we can access this later on in the build.
          -->
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
              <!--
                  Prepares the property pointing to the JaCoCo runtime agent which
                  is passed as VM argument when Maven the Surefire plugin is executed.
              -->
              <execution>
                <id>pre-unit-test</id>
                <phase>generate-test-sources</phase>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <!--
                      Sets the name of the property containing the settings
                      for JaCoCo runtime agent.
                  -->
                  <propertyName>surefireArgLine</propertyName>
                </configuration>
              </execution>
              <!--
                  Prepares the property pointing to the JaCoCo runtime agent which
                  is passed as VM argument when Maven the Failsafe plugin is executed.
              -->
              <execution>
                <id>pre-integration-test</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>prepare-agent-integration</goal>
                </goals>
                <configuration>
                  <!--
                      Sets the name of the property containing the settings
                      for JaCoCo runtime agent.
                  -->
                  <propertyName>failsafeArgLine</propertyName>
                </configuration>
              </execution>
              <!--
                  Check if the unit-test-coverage is at least a certain minimum.
              -->
              <execution>
                <id>check-coverage</id>
                <phase>verify</phase>
                <goals>
                  <goal>check</goal>
                </goals>
                <configuration>
                  <!-- TODO: Turn this on as soon as possible. -->
                  <haltOnFailure>false</haltOnFailure>
                  <rules>
                    <rule implementation="org.jacoco.maven.RuleConfiguration">
                      <element>BUNDLE</element>
                      <limits>
                        <!-- Fail the build if the instruction level coverage is below 80%. -->
                        <limit implementation="org.jacoco.report.check.Limit">
                          <counter>INSTRUCTION</counter>
                          <value>COVEREDRATIO</value>
                          <minimum>0.50</minimum>
                        </limit>
                        <!-- Fail the build if there are classes without any coverage. -->
                        <limit implementation="org.jacoco.report.check.Limit">
                          <counter>CLASS</counter>
                          <value>MISSEDCOUNT</value>
                          <maximum>0</maximum>
                        </limit>
                      </limits>
                    </rule>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <!--
            Make the surefire execute all unit-tests
          -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <!--
                We have to slightly increase the heap-size or some tests will fail.
                Notice the @ instead of the $ as prefix? That's late evaluation.
              -->
              <argLine>-Xmx256m @{surefireArgLine}</argLine>
              <includes>
                <include>**/*Test.java</include>
                <include>**/*Tests.java</include>
                <include>**/*Spec.java</include>
              </includes>
            </configuration>
          </plugin>

          <!--
            Make the failsafe execute all integration-tests
          -->
          <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>
            <configuration>
              <!--
                    Notice the @ instead of the $ as prefix? That's late evaluation.
              -->
              <argLine>@{failsafeArgLine}</argLine>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>apache-release</id>
      <build>
        <plugins>
          <!--
            Create MD5 and SHA512 checksum files for the release artifacts.
          -->
          <plugin>
            <groupId>net.nicoulaj.maven.plugins</groupId>
            <artifactId>checksum-maven-plugin</artifactId>
            <version>1.7</version>
            <executions>
              <execution>
                <goals>
                  <goal>files</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <algorithms>
                <algorithm>SHA-512</algorithm>
              </algorithms>
              <fileSets>
                <fileSet>
                  <directory>${project.build.directory}</directory>
                  <includes>
                    <include>apache-plc4x-incubating-${project.version}-source-release.zip</include>
                  </includes>
                </fileSet>
              </fileSets>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>