<?xml version="1.0" encoding="UTF-8"?>
<!--
 - Copyright (C) 2019-2021 ConnectorIO Sp. z o.o.
 -
 - 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.
 -
 - SPDX-License-Identifier: Apache-2.0
 -->
<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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.connectorio.addons</groupId>
    <artifactId>parent</artifactId>
    <version>3.0.0-pr-125-SNAPSHOT</version>
    <relativePath>../parent/pom.xml</relativePath>
  </parent>

  <artifactId>features</artifactId>
  <packaging>pom</packaging>

  <name>ConnectorIO - Addons - Features</name>
  <description>Karaf related feature sets.</description>

  <modules>
    <module>org.connectorio.addons.feature</module>
    <module>org.connectorio.addons.feature.amsads</module>
    <module>org.connectorio.addons.feature.askoheat</module>
    <module>org.connectorio.addons.feature.bacnet</module>
    <module>org.connectorio.addons.feature.canopen</module>
    <module>org.connectorio.addons.feature.fatek</module>
    <module>org.connectorio.addons.feature.io</module>
    <module>org.connectorio.addons.feature.io.transport.mbus</module>
    <module>org.connectorio.addons.feature.io.transport.serial</module>
    <module>org.connectorio.addons.feature.managed</module>
    <module>org.connectorio.addons.feature.mbus</module>
    <module>org.connectorio.addons.feature.mqtt</module>
    <module>org.connectorio.addons.feature.network</module>
    <module>org.connectorio.addons.feature.norule</module>
    <module>org.connectorio.addons.feature.opcua</module>
    <module>org.connectorio.addons.feature.ocpp</module>
    <module>org.connectorio.addons.feature.persistence</module>
    <module>org.connectorio.addons.feature.plc4x</module>
    <module>org.connectorio.addons.feature.profile</module>
    <module>org.connectorio.addons.feature.relayweblog</module>
    <module>org.connectorio.addons.feature.s7</module>
    <module>org.connectorio.addons.feature.smartme</module>
    <module>org.connectorio.addons.feature.wmbus</module>
    <module>org.connectorio.feature.chrono</module>
  </modules>

  <profiles>
    <profile>
      <id>feature</id>
      <activation>
        <file>
          <exists>src/main/feature/feature.xml</exists>
        </file>
      </activation>

      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-feature-xml</id>
                <goals>
                  <goal>attach-artifact</goal>
                </goals>
                <configuration>
                  <artifacts>
                    <artifact>
                      <file>${feature.file}</file>
                      <classifier>features</classifier>
                      <type>xml</type>
                    </artifact>
                  </artifacts>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
