<?xml version="1.0" encoding="UTF-8"?>
<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>ru.entaxy</groupId>
        <artifactId>entaxy-root</artifactId>
        <version>1.0</version>
    </parent>

    <groupId>ru.entaxy.esb</groupId>
    <artifactId>root</artifactId>
    <version>1.9.0</version>
    <packaging>pom</packaging>

    <name>ENTAXY :: ESB :: ROOT</name>
    <description>ENTAXY :: ESB :: ROOT</description>

    <modules>
        <!-- MUST BE FIRST -->
        <module>update-management</module>

        <module>underlying</module>
        <module>system</module>
        <module>platform</module>
        <module>test-suites</module>
        <!-- module>./distribution</module -->
        <module>ui</module>

        <!-- MUST BE LAST -->
        <module>update</module>
    </modules>

    <repositories>
        <repository>
            <id>entaxy-public</id>
            <url>https://nexus.entaxy.ru/nexus/repository/entaxy-public/</url>
        </repository>
    </repositories>

    <properties>

        <!-- @TODO consider import Karaf BOM to root/pom/dependencyManagement -->
        <felix.configadmin.version>1.9.16</felix.configadmin.version>
        <felix.scr.version>2.1.20</felix.scr.version>

        <!-- osgi -->
        <osgi.service.component.annotations.version>1.4.0</osgi.service.component.annotations.version>

        <servicemix-specs-version>2.9.0</servicemix-specs-version>

        <!-- from 'camel-xslt-saxon' feature -->
        <servicemix-saxon-version>9.9.1-6_1</servicemix-saxon-version>

        <caffeine-version>2.8.4</caffeine-version>
        <activemq.version>2.19.0</activemq.version>
        <hibernate.version>5.2.17.Final</hibernate.version>
        <jpa.version>2.1.0</jpa.version>
        <aether.version>1.1.0</aether.version>
        <spring.bundles.version>5.2.5.RELEASE_1</spring.bundles.version>
        <spring.version>5.2.5.RELEASE</spring.version>
        <mapstruct.version>1.3.1.Final</mapstruct.version>
        <ignite.version>2.8.1</ignite.version>
        <hazelcast.version>3.12.8</hazelcast.version>
        <gson.version>2.8.5</gson.version>
        <liquibase.version>3.6.3</liquibase.version>
        <mssql.version>7.4.1.jre8</mssql.version>
        <freemarker.version>2.3.31</freemarker.version>
        <!-- postgresql.version>42.2.5</postgresql.version -->
        <!--
        	version should be 42.2.7 or higher
        	to avoid
        		java.lang.ClassNotFoundException: javax.security.sasl.SaslException not found by org.postgresql.jdbc42
        	see https://github.com/pgjdbc/pgjdbc/issues/1503
         -->
        <postgresql.version>42.2.9</postgresql.version>
        <slf4j.version>1.7.30</slf4j.version>

        <javax.transaction.version>1.2</javax.transaction.version>
        <javax.interceptor.version>1.2</javax.interceptor.version>
        <javax.annotation-api.version>1.3.2</javax.annotation-api.version>
        <javax.validation-api.version>1.1.0.Final</javax.validation-api.version>

        <commons-lang3.version.old>3.2.1</commons-lang3.version.old>
        <commons-lang3.version>3.12.0</commons-lang3.version>
        <commons-lang.version>2.6</commons-lang.version>
        <xerces.version>2.12.0</xerces.version>
        <commons-io.version>2.0.1</commons-io.version>
        <commons-codec.version>1.14</commons-codec.version>
        <log4j.version>1.2.17</log4j.version>
        <jaxb.version>2.4.0-b180830.0438</jaxb.version>
        <jaxb-api.version>2.3.1</jaxb-api.version>
        <jaxb-impl.version>2.3.2</jaxb-impl.version>
        <jaxb-core.version>2.3.0.1</jaxb-core.version>
        <jaxb-xjc.version>2.2.11</jaxb-xjc.version>
        <jaxws-api.version>2.3.1</jaxws-api.version>
        <javax.jws-api.version>1.1</javax.jws-api.version>
        <jaxws.version>2.3.3</jaxws.version>

        <jackson.version>2.15.2</jackson.version>

        <snakeyaml1.version>1.33</snakeyaml1.version>
        <snakeyaml2.version>2.0</snakeyaml2.version>

        <commons-collections4.version>4.4</commons-collections4.version>

        <javassist.version>3.29.0-GA</javassist.version>
        <javassist.version.clean>3.29.0</javassist.version.clean>

        <classgraph.version>4.8.160</classgraph.version>

        <swagger1.version>1.6.11</swagger1.version>
        <swagger.v3.version>2.2.11</swagger.v3.version>
        <swagger-ui.version>3.52.5</swagger-ui.version>

        <!-- versions for support components -->
        <javaparser.version>3.25.3</javaparser.version>
        <swagger-parser.version>2.1.15</swagger-parser.version>
        <openapi-generator.version>6.6.0</openapi-generator.version>

        <!-- bundle settings -->
        <bundle.osgi.import.pkg>*</bundle.osgi.import.pkg>
        <bundle.osgi.private.pkg>{local-packages}</bundle.osgi.private.pkg>
        <bundle.osgi.export.pkg/>
        <bundle.osgi.dynamicimport.pkg/>
        <bundle.osgi.export.service/>
        <bundle.osgi.embed.dependency/>
        <bundle.osgi.persistence/>
        <bundle.osgi.remove.headers>Karaf-Commands</bundle.osgi.remove.headers>
        <bundle.osgi.karaf.services.artifactInclude>.*</bundle.osgi.karaf.services.artifactInclude>
        <!-- not used anymore -->
        <bundle.osgi.activator/>

        <!-- ui -->
        <hawtio.version>2.14.1</hawtio.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- osgi -->
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.service.component.annotations</artifactId>
                <version>${osgi.service.component.annotations.version}</version>
                <scope>compile</scope>
            </dependency>

            <!-- Karaf -->
            <dependency>
                <groupId>org.apache.karaf.features</groupId>
                <artifactId>org.apache.karaf.features.core</artifactId>
                <version>${karaf.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf</groupId>
                <artifactId>org.apache.karaf.util</artifactId>
                <version>${karaf.version}</version>
            </dependency>

            <!-- Felix -->
            <dependency>
                <groupId>org.apache.felix</groupId>
                <artifactId>org.apache.felix.scr</artifactId>
                <version>${felix.scr.version}</version>
            </dependency>

            <!-- Camel BOM -->
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-parent</artifactId>
                <version>${camel.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-bom</artifactId>
                <version>${camel.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- JAXB for Java 11 -->
            <dependency>
                <groupId>org.glassfish.jaxb</groupId>
                <artifactId>jaxb-runtime</artifactId>
                <version>${jaxb.version}</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.ws</groupId>
                <artifactId>jaxws-rt</artifactId>
                <version>${jaxws.version}</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.ws</groupId>
                <artifactId>jaxws-ri</artifactId>
                <version>${jaxws.version}</version>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>javax.xml.bind</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>${jaxb-api.version}</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-core</artifactId>
                <version>${jaxb-core.version}</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-impl</artifactId>
                <version>${jaxb-impl.version}</version>
            </dependency>

            <!-- logging -->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jul-to-slf4j</artifactId>
                <version>${slf4j.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>${log4j.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- database -->
            <dependency>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-core</artifactId>
                <version>${liquibase.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- @TODO REMOVE -->
            <dependency>
                <groupId>com.microsoft.sqlserver</groupId>
                <artifactId>mssql-jdbc</artifactId>
                <version>${mssql.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- @TODO REMOVE -->
            <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>${postgresql.version}</version>
                <scope>provided</scope>
            </dependency>


            <!-- others -->
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${gson.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-collections4</artifactId>
                <version>${commons-collections4.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>osgi.core</artifactId>
		</dependency>
	</dependencies>

    <build>
        <resources>
            <!-- globally enable resource filtering -->
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
            <!-- then disable it for specific resources -->
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*context.xml</include>
                    <include>**/*blueprint.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>properties-maven-plugin</artifactId>
                    <version>${properties-maven-plugin.version}-ENTAXY</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>${maven-bundle-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <obrRepository>NONE</obrRepository>
                    <instructions>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Description>${project.description}</Bundle-Description>
                        <Export-Package>${bundle.osgi.export.pkg}</Export-Package>
                        <Import-Package>${bundle.osgi.import.pkg}</Import-Package>
                        <Private-Package>${bundle.osgi.private.pkg}</Private-Package>
                        <DynamicImport-Package>${bundle.osgi.dynamicimport.pkg}</DynamicImport-Package>
                        <Export-Service/>
                        <Embed-Dependency>${bundle.osgi.embed.dependency}</Embed-Dependency>
                        <Meta-Persistence>${bundle.osgi.persistence}</Meta-Persistence>

                        <!-- breaks @Services annotation-based manifest generation -->
                        <!-- Bundle-Activator>${bundle.osgi.activator}</Bundle-Activator -->

                        <!-- BND instruction to remove headers from manifest -->
                        <!-- by default we remove "Karaf-Commands" header -->
                        <_removeheaders>${bundle.osgi.remove.headers}</_removeheaders>
                    </instructions>
                </configuration>
            </plugin>
            <!-- support for @Services annotation and annotations related to shell commands -->
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-services-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>service-metadata-generate</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>service-metadata-generate</goal>
                        </goals>
                        <configuration>
                            <artifactInclude>${bundle.osgi.karaf.services.artifactInclude}</artifactInclude>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- compiler plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <version>${karaf.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>

            <!-- CICD stuff -->
            <!--            <plugin>-->
            <!--                <groupId>org.apache.maven.plugins</groupId>-->
            <!--                <artifactId>maven-release-plugin</artifactId>-->
            <!--                <version>2.5.3</version>-->
            <!--               <configuration>-->
            <!--                    <autoVersionSubmodules>true</autoVersionSubmodules>-->
            <!--                    <tagNameFormat>v@{project.version}</tagNameFormat>-->
            <!--                    <releaseProfiles>emdev.repo</releaseProfiles>-->
            <!--                    <developmentVersion>${parsedVersion.majorVersion}.${parsedVersion.nextMinorVersion}.0-SNAPSHOT</developmentVersion>-->
            <!--                    <branchName>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}</branchName>-->
            <!--                </configuration>-->
            <!--            </plugin>-->
            <!--            <plugin>-->
            <!--                <groupId>org.codehaus.mojo</groupId>-->
            <!--                <artifactId>build-helper-maven-plugin</artifactId>-->
            <!--                <version>1.8</version>-->
            <!--                <inherited>false</inherited>-->
            <!--                <executions>-->
            <!--                    <execution>-->
            <!--                        <id>parse-versions-for-release</id>-->
            <!--                        <phase>validate</phase>-->
            <!--                        <goals>-->
            <!--                            <goal>parse-version</goal>-->
            <!--                        </goals>-->
            <!--                        <configuration>-->
            <!--                            <propertyPrefix>parsedVersion</propertyPrefix>-->
            <!--                        </configuration>-->
            <!--                    </execution>-->
            <!--                </executions>-->
            <!--              </plugin>-->
            <!--              <plugin>-->
            <!--                <groupId>org.apache.maven.plugins</groupId>-->
            <!--                <artifactId>maven-antrun-plugin</artifactId>-->
            <!--                <version>1.8</version>-->
            <!--                <executions>-->
            <!--                    <execution>-->
            <!--                        <inherited>false</inherited>-->
            <!--                        <phase>initialize</phase>-->
            <!--                        <goals>-->
            <!--                            <goal>run</goal>-->
            <!--                        </goals>-->
            <!--                        <configuration>-->
            <!--                            <target>-->
            <!--                                <echo>Major: ${parsedVersion.majorVersion}</echo>-->
            <!--                                <echo>Minor: ${parsedVersion.minorVersion}</echo>-->
            <!--                                <echo>Next Minor: ${parsedVersion.nextMinorVersion}</echo>-->
            <!--                                <echo>Incremental: ${parsedVersion.incrementalVersion}</echo>-->
            <!--                                <echo>Qualifier: ${parsedVersion.qualifier}</echo>-->
            <!--                                <echo>BuildNumber: ${parsedVersion.buildNumber}</echo>-->
            <!--                            </target>-->
            <!--                        </configuration>-->
            <!--                    </execution>-->
            <!--                </executions>-->
            <!--            </plugin>-->
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>public-deploy</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <distributionManagement>
                <repository>
                    <id>entaxy-public-entaxy</id>
                    <name>entaxy-public-entaxy</name>
                    <uniqueVersion>false</uniqueVersion>
                    <layout>default</layout>
                    <!--  url>http://localhost:8981/repository/entaxy-public-entaxy/</url -->
                    <url>https://nexus.entaxy.ru/nexus/repository/entaxy-public-entaxy/</url>
                </repository>
                <!-- we don't publish snapshots -->
                <!-- snapshotRepository>
                    <id>entaxy-private-snapshots</id>
                    <name>entaxy-private-snapshots</name>
                    <uniqueVersion>false</uniqueVersion>
                    <layout>default</layout>
                    <url>http://localhost:8981/repository/entaxy-private-snapshots/</url>
                </snapshotRepository -->
            </distributionManagement>
        </profile>


        <!--
        BEGIN
        !!! kars generation
        -->
        <profile>
            <id>prepare-main-features-for-kars</id>
            <activation>
                <property>
                    <name>mainKars</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-main-features-for-kars</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/kars/features</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main/features</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>*.xml</include>
                                            </includes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>prepare-update-features-for-kars</id>
            <activation>
                <property>
                    <name>updateKars</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-update-features-for-kars</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/kars/features</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/update/features</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>*.xml</include>
                                            </includes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>


        <profile>
            <id>create-attach-kars</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <!-- file>
                    <exists>src/main/features</exists>
                </file>
                <property>
                    <name>kars</name>
                    <value>true</value>
                </property -->
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>define-install-skip</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                                 classpathref="maven.plugin.classpath"/>
                                        <if>
                                            <contains string="bundle jar war" substring="${project.packaging}"/>
                                            <then>
                                                <property name="install.skip" value="true"/>
                                            </then>
                                            <else>
                                                <property name="install.skip" value="false"/>
                                            </else>
                                        </if>
                                        <!-- echo>  === ITERATOR.SKIP :: ${iterator.skip}</echo -->
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- skip executing bundle-specific plugins -->

                    <plugin>
                        <groupId>org.apache.felix</groupId>
                        <artifactId>maven-bundle-plugin</artifactId>
                        <extensions>true</extensions>
                        <executions>
                            <execution>
                                <id>default-bundle</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-compile</id>
                                <phase>none</phase>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>default-testCompile</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-install-plugin</artifactId>
                        <configuration>
                            <skip>${install.skip}</skip>
                        </configuration>
                    </plugin>

                    <plugin>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <configuration>
                            <skip>${install.skip}</skip>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.karaf.tooling</groupId>
                        <artifactId>karaf-services-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>service-metadata-generate</id>
                                <phase>none</phase>
                                <goals>
                                    <goal>service-metadata-generate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-war</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- specially for woodstox -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <version>3.4.0</version>
                        <executions>
                            <execution>
                                <phase>none</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <skip>${install.skip}</skip>
                        </configuration>
                    </plugin>
                    <!--
                        PLUGINS
                     -->

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>collect-features-files-for-kars</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                                 classpathref="maven.plugin.classpath"/>
                                        <propertyregex property="groupFolder" input="${project.groupId}" regexp="\."
                                                       replace="/" global="true"/>
                                        <if>
                                            <available file="${project.build.directory}/kars/features" type="dir"/>
                                            <then>
                                                <pathconvert property="kars.features.list.tmp">
                                                    <fileset dir="${project.build.directory}/kars/features"
                                                             erroronmissingdir="false">
                                                        <include name="*.*"/>
                                                    </fileset>
                                                </pathconvert>
                                                <!-- echo>[file.list.tmp] ${file.list.tmp}</echo -->
                                                <echo file="${project.build.directory}/kars/features.list">
                                                    ${kars.features.list.tmp}
                                                </echo>
                                                <replace file="${project.build.directory}/kars/features.list" token="\"
                                                         value="/"/>
                                                <loadfile property="kars.features.list"
                                                          srcFile="${project.build.directory}/kars/features.list"/>
                                                <property name="iterator.skip" value="false"/>
                                            </then>
                                            <else>
                                                <property name="iterator.skip" value="true"/>
                                            </else>
                                        </if>
                                        <!-- echo>  === ITERATOR.SKIP :: ${iterator.skip}</echo -->
                                    </target>
                                </configuration>
                            </execution>

                            <!-- TO REMOVE -->
                            <!-- execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <echo>Displaying value of 'file.list' property</echo>
                                        <echo>[file.list] ${file.list}</echo>
                                    </target>
                                </configuration>
                            </execution -->

                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.soebes.maven.plugins</groupId>
                        <artifactId>iterator-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>iterate-features-files-for-kars</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>iterator</goal>
                                </goals>
                                <configuration>
                                    <skip>${iterator.skip}</skip>
                                    <content>${kars.features.list}</content>
                                    <delimiter>${path.separator}</delimiter>
                                    <pluginExecutors>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                                             classpathref="maven.plugin.classpath"/>


                                                    <property name="item.current">@item@</property>
                                                    <basename property="filename.full" file="${item.current}"
                                                              suffix=".xml"/>
                                                    <echo file="${project.build.directory}/kars/current-properties">
                                                        filename.current=${filename.full}
                                                    </echo>

                                                    <!--
                                                        Add features repo file to resources system with CORRECT classifier
                                                        We MUST do it 'cause karaf-plugin adds it with "features" classifier
                                                     -->
                                                    <copy file="${project.build.directory}/kars/features/${filename.full}.xml"
                                                          toFile="${project.build.directory}/kars/resources/${filename.full}/resources/system/${groupFolder}/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}-${filename.full}.xml"
                                                          overwrite="true" force="true"/>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>properties-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>read-project-properties</goal>
                                            <configuration>
                                                <files>
                                                    <file>${project.build.directory}/kars/current-properties</file>
                                                </files>
                                            </configuration>
                                        </pluginExecutor>

                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.karaf.tooling</groupId>
                                                <artifactId>karaf-maven-plugin</artifactId>
                                                <version>${karaf.version}</version>
                                                <extensions>true</extensions>
                                            </plugin>
                                            <goal>kar</goal>
                                            <configuration>
                                                <!-- enableGeneration>true</enableGeneration -->
                                                <finalName>${project.artifactId}.${filename.current}</finalName>
                                                <!-- javase>11</javase -->
                                                <!-- generateConsistencyReport>${project.build.directory}</generateConsistencyReport -->
                                                <!-- consistencyReportProjectName>Entaxy Karaf (full)</consistencyReportProjectName -->
                                                <!-- pathPrefix>${project.artifactId}</pathPrefix -->
                                                <resourcesDir>
                                                    ${project.build.directory}/kars/resources/${filename.current}
                                                </resourcesDir>
                                                <repositoryPath>resources/system/</repositoryPath>
                                                <featuresFile>
                                                    ${project.build.directory}/kars/features/${filename.current}.xml
                                                </featuresFile>
                                            </configuration>

                                        </pluginExecutor>

                                        <!-- remove repo with "features" classifier added by karaf plugin -->
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <if>
                                                        <equals arg1="${filename.current}" arg2="features"/>
                                                        <then>
                                                            <!-- noop -->
                                                        </then>
                                                        <else>
                                                            <propertyregex property="groupFolder"
                                                                           input="${project.groupId}" regexp="\."
                                                                           replace="/" global="true"/>
                                                            <unzip src="${project.build.directory}/${project.artifactId}.${filename.current}.kar"
                                                                   dest="${project.build.directory}/${filename.current}-contents"/>
                                                            <delete file="${project.build.directory}/${filename.current}-contents/resources/system/${groupFolder}/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}-features.xml"/>
                                                            <delete file="${project.build.directory}/${project.artifactId}.${filename.current}.kar"/>
                                                            <zip destfile="${project.build.directory}/${project.artifactId}.${filename.current}.kar"
                                                                 basedir="${project.build.directory}/${filename.current}-contents"
                                                                 includes="**/*"/>
                                                        </else>
                                                    </if>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>build-helper-maven-plugin</artifactId>
                                                <version>${build-helper-maven-plugin.version}</version>
                                            </plugin>
                                            <goal>attach-artifact</goal>
                                            <configuration>
                                                <artifacts>
                                                    <artifact>
                                                        <file>target/${project.artifactId}.${filename.current}.kar
                                                        </file>
                                                        <type>kar</type>
                                                        <classifier>${filename.current}</classifier>
                                                    </artifact>
                                                </artifacts>
                                            </configuration>
                                        </pluginExecutor>
                                    </pluginExecutors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!--
        END
        !!! kars generation
        -->

        <!--
        BEGIN
        !!! license management
        localize all the licensing functionality to autostarting (for now) profile
        -->
        <profile>

            <id>license</id>
            <activation>
                <property>
                    <name>processLicense</name>
                    <value>true</value>
                </property>
            </activation>

            <properties>

                <!-- we can use ${project.organization.name} here, but we won't -->
                <license.organizationName>EmDev LLC</license.organizationName>

                <license.inceptionYear>2020</license.inceptionYear>
                <license.projectName>${project.artifactId}</license.projectName>
                <license.copyrightOwners>${license.organizationName}</license.copyrightOwners>
                <license.licenseName>apache_v2</license.licenseName>

                <license.processStartTag>~~~~~~licensing~~~~~~</license.processStartTag>
                <license.processEndTag>~~~~~~/licensing~~~~~~</license.processEndTag>
                <license.sectionDelimiter>==========</license.sectionDelimiter>
                <license.update.headers.exclude />
            </properties>

            <build>

                <resources>
                    <!-- we have to configure it due to (see below): -->
                    <resource>
                        <filtering>false</filtering>
                        <directory>${project.build.directory}/generated-sources/license</directory>

                        <!-- (1) only META-INF/LICENSE is included due to potential bug
                        (see comment below at "add-third-party" goal of license-maven-plugin configuration),
                        so to add META-INF/DEPENDENCIES also we have to treat them all as resources -->
                        <includes>
                            <include>META-INF/*</include>
                        </includes>

                        <!-- (2) we don't need no ...
                            - education?
                            - NO! LICENSE.txt and THIRD-PARTY.txt at the root of the bundle  -->
                        <excludes>
                            <exclude>*.txt</exclude>
                        </excludes>
                    </resource>
                </resources>

                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>${build-helper-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>timestamp-property</id>
                                <goals>
                                    <goal>timestamp-property</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <name>current.year</name>
                                    <pattern>yyyy</pattern>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>update-project-license</id>
                                <goals>
                                    <goal>update-project-license</goal>
                                </goals>
                                <configuration>
                                    <organizationName>${license.organizationName}</organizationName>
                                    <inceptionYear>${license.inceptionYear}</inceptionYear>
                                    <projectName>${license.projectName}</projectName>
                                    <copyrightOwners>${license.copyrightOwners}</copyrightOwners>
                                    <licenseName>${license.licenseName}</licenseName>

                                    <keepBackup>false</keepBackup>

                                    <bundleLicensePath>META-INF/LICENSE</bundleLicensePath>
                                    <generateBundle>true</generateBundle>
                                </configuration>
                            </execution>

                            <execution>
                                <id>add-third-party</id>
                                <goals>
                                    <goal>add-third-party</goal>
                                </goals>
                                <configuration>
                                    <bundleThirdPartyPath>META-INF/DEPENDENCIES</bundleThirdPartyPath>

                                    <!-- in fact this isn't added to bundle, so we configure "resources" in the profile -->
                                    <generateBundle>true</generateBundle>

                                    <includeTransitiveDependencies>false</includeTransitiveDependencies>
                                    <excludedScopes>test, provided</excludedScopes>

                                    <!--
                                        - we don't need ..
                                        - no education?
                                        - shut up! we don't need our own modules being mentioned as 3rd-party dependencies
                                     -->
                                    <excludedGroups>^ru\.entaxy\.esb</excludedGroups>

                                    <licenseMerges>
                                        <licenseMerge>Apache License, Version 2.0|The Apache Software License, Version
                                            2.0|The Apache License, Version 2.0|Apache 2.0 License|Apache 2.0|Apache-2.0
                                        </licenseMerge>
                                        <licenseMerge>EDL 1.0|Eclipse Distribution License v. 1.0|Eclipse Distribution
                                            License - v 1.0
                                        </licenseMerge>
                                        <licenseMerge>EPL 2.0|Eclipse Public License v. 2.0</licenseMerge>
                                        <licenseMerge>EPL 1.0|Eclipse Public License v. 1.0|Eclipse Public License
                                            v1.0
                                        </licenseMerge>
                                        <licenseMerge>CDDL/GPLv2+CE|CDDL + GPLv2 with classpath exception</licenseMerge>
                                        <licenseMerge>GPLv2+CE|GPL2 w/ CPE</licenseMerge>
                                        <licenseMerge>CDDL/GPL|CDDL+GPL License</licenseMerge>
                                        <licenseMerge>LGPL|lgpl|GNU Lesser General Public License</licenseMerge>
                                        <licenseMerge>BSD|The BSD License</licenseMerge>
                                        <licenseMerge>MIT|MIT License</licenseMerge>
                                    </licenseMerges>
                                </configuration>
                            </execution>

                            <execution>
                                <id>update-file-header</id>
                                <goals>
                                    <goal>update-file-header</goal>
                                </goals>
                                <phase>process-sources</phase>
                                <configuration>
                                    <organizationName>${license.organizationName}</organizationName>
                                    <inceptionYear>${license.inceptionYear}</inceptionYear>
                                    <projectName>${license.projectName}</projectName>
                                    <copyrightOwners>${license.copyrightOwners}</copyrightOwners>
                                    <licenseName>${license.licenseName}</licenseName>
                                    <canUpdateCopyright>true</canUpdateCopyright>

                                    <!-- plugin documentation recommends "true"
                                    but we use "false" to look like Apache sources -->
                                    <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                                    <emptyLineAfterHeader>false</emptyLineAfterHeader>

                                    <excludes>
                                        <exclude>**/*.json</exclude>
                                        <!-- *.ftl files will be processed by the next plugin -->
                                        <exclude>**/*.ftl</exclude>
                                        <exclude>${license.update.headers.exclude}</exclude>
                                        <exclude>**/resources/ru/entaxy/resource/**</exclude>
                                    </excludes>
                                    <extraExtensions>
                                        <!-- treat *.cfg files as *.properties -->
                                        <cfg>properties</cfg>
                                        <h2>properties</h2>
                                        <pg>properties</pg>
                                        <install>properties</install>
                                        <xslt>xml</xslt>
                                    </extraExtensions>

                                    <ignoreNoFileToScan>true</ignoreNoFileToScan>
                                    <keepBackup>false</keepBackup>

                                    <processStartTag>${license.processStartTag}</processStartTag>
                                    <processEndTag>${license.processEndTag}</processEndTag>
                                    <sectionDelimiter>${license.sectionDelimiter}</sectionDelimiter>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>ru.entaxy</groupId>
                                <artifactId>license</artifactId>
                                <version>1.0</version>
                            </dependency>
                        </dependencies>
                    </plugin>

                    <plugin>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>update-ftl-header</id>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                                <phase>process-sources</phase>
                                <configuration>
                                    <properties>
                                        <owner>EmDev LLC</owner>
                                        <email>entaxy@entaxy.ru</email>
                                        <year>${current.year}</year>
                                    </properties>
                                    <licenseSets>
                                        <licenseSet>
                                            <!-- header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header -->
                                            <inlineHeader>
~~~~~~licensing~~~~~~
${project.artifactId}
==========
Copyright (C) 2020 - ${year} ${owner}
==========
You may not use this file except in accordance with the License Terms of
the Copyright
Holder located at: https://entaxy.ru/eula . All copyrights, all
intellectual property
rights to the Software and any copies are the property of the Copyright
Holder. Unless
it is explicitly allowed the Copyright Holder, the User is prohibited
from using the
Software for commercial purposes to provide services to third parties.

The Copyright Holder hereby declares that the Software is provided on an
"AS IS".
Under no circumstances does the Copyright Holder guarantee or promise
that the
Software provided by him will be suitable or not suitable for the
specific purposes
of the User, that the Software will meet all commercial and personal
subjective
expectations of the User, that the Software will work properly, without
technical
errors, quickly and uninterruptedly.

Under no circumstances shall the Copyright Holder or its Affiliates is
not liable
to the User for any direct or indirect losses of the User, his expenses
or actual
damage, including, downtime; loss of bussines; lost profit; lost
earnings; loss
or damage to data, property, etc.
~~~~~~/licensing~~~~~~
                                            </inlineHeader>
                                            <excludes>
                                                <exclude>**/resources/ru/entaxy/templates/**</exclude>
                                            </excludes>
                                            <includes>
                                                <include>**/*.ftl</include>
                                            </includes>
                                        </licenseSet>
                                    </licenseSets>
                                    <mapping>
                                        <ftl>FTL_ALT</ftl>
                                    </mapping>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>

            </build>

        </profile>

        <profile>
            <id>license-aggregate</id>
            <activation>
                <file>
                    <exists>aggregate.marker</exists>
                </file>
                <property>
                    <name>processLicense</name>
                    <value>true</value>
                </property>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <executions>
                            <!-- collect all the dependencies through all the underlying modules
                             -->
                            <execution>
                                <id>aggregate-add-third-party</id>
                                <goals>
                                    <goal>aggregate-add-third-party</goal>
                                </goals>
                                <phase>prepare-package</phase>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/generated-sources/license
                                    </outputDirectory>
                                    <thirdPartyFilename>ALL-DEPENDENCIES</thirdPartyFilename>

                                    <acceptPomPackaging>true</acceptPomPackaging>
                                    <includeTransitiveDependencies>false</includeTransitiveDependencies>
                                    <excludeTransitiveDependencies>true</excludeTransitiveDependencies>
                                    <excludedGroups>^ru\.entaxy\.esb</excludedGroups>
                                    <excludedScopes>test, provided</excludedScopes>
                                    <licenseMerges>
                                        <licenseMerge>Apache License, Version 2.0|The Apache Software License, Version
                                            2.0|The Apache License, Version 2.0|Apache 2.0 License|Apache 2.0
                                        </licenseMerge>
                                        <licenseMerge>EDL 1.0|Eclipse Distribution License v. 1.0|Eclipse Distribution
                                            License - v 1.0
                                        </licenseMerge>
                                        <licenseMerge>EPL 2.0|Eclipse Public License v. 2.0</licenseMerge>
                                        <licenseMerge>EPL 1.0|Eclipse Public License v. 1.0|Eclipse Public License
                                            v1.0
                                        </licenseMerge>
                                        <licenseMerge>CDDL/GPLv2+CE|CDDL + GPLv2 with classpath exception</licenseMerge>
                                        <licenseMerge>GPLv2+CE|GPL2 w/ CPE</licenseMerge>
                                        <licenseMerge>CDDL/GPL|CDDL+GPL License</licenseMerge>
                                        <licenseMerge>LGPL|lgpl|GNU Lesser General Public License</licenseMerge>
                                        <licenseMerge>BSD|The BSD License</licenseMerge>
                                        <licenseMerge>MIT|MIT License</licenseMerge>
                                    </licenseMerges>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-dependencies</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>attach-artifact</goal>
                                </goals>
                                <configuration>
                                    <artifacts>
                                        <artifact>
                                            <file>target/generated-sources/license/ALL-DEPENDENCIES</file>
                                            <type>deps</type>
                                            <classifier>aggregated</classifier>
                                        </artifact>
                                    </artifacts>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>

        </profile>
        <!--
	        END
	        !!! license management
        -->


        <!--
	        BEGIN
	        !!! attach management
        -->
        <profile>
            <id>disable-attaches</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>set-disable-attaches</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <property name="disable.attaches">true</property>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>prepare-attaches-main</id>
            <activation>
                <!-- file>
                    <exists>src/main</exists>
                </file-->
                <property>
                    <name>!skipMainAttach</name>
                </property>
            </activation>
            <properties>
                <features.defaults>
                    default.artifact.extension=xml
                    default.file.folder=
                    fragments.generate=false
                    fragments.folder=src/main/features
                </features.defaults>
                <healthcheck.defaults>
                    default.artifact.extension=cfg
                    default.file.folder=etc
                    fragments.generate=true
                    fragments.folder=src/main/healthcheck
                </healthcheck.defaults>
                <scripts.defaults>
                    default.artifact.extension=script
                    default.file.folder=scripts
                    fragments.generate=true
                    fragments.folder=src/main/scripts
                </scripts.defaults>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-main-attaches</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <skip>${disable.attaches}</skip>
                                    <outputDirectory>${project.build.directory}/attach-resources/resources
                                    </outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>features/*.xml</include>
                                                <include>healthcheck/*.cfg</include>
                                                <include>scripts/**/*</include>
                                            </includes>
                                            <excludes>
                                                <exclude>*/generated/*</exclude>
                                            </excludes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>prepare-attaches-update</id>
            <activation>
                <property>
                    <name>updateAttach</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <update.features.defaults>
                    default.artifact.extension=xml
                    default.file.folder=
                    fragments.generate=false
                    fragments.folder=src/update/features
                </update.features.defaults>
                <update.healthcheck.defaults>
                    default.artifact.extension=cfg
                    default.file.folder=etc
                    fragments.generate=true
                    fragments.folder=src/update/healthcheck
                </update.healthcheck.defaults>
                <update.scripts.defaults>
                    default.artifact.extension=script
                    default.file.folder=updates/${project.version}
                    fragments.generate=true
                    fragments.folder=src/update/scripts
                </update.scripts.defaults>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-update-attaches</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <skip>${disable.attaches}</skip>
                                    <outputDirectory>${project.build.directory}/attach-resources/resources
                                    </outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/update/features</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>*.xml</include>
                                            </includes>
                                            <excludes>
                                                <exclude>generated/*</exclude>
                                            </excludes>
                                            <targetPath>
                                                ${project.build.directory}/attach-resources/resources/update.features
                                            </targetPath>
                                        </resource>
                                        <resource>
                                            <directory>src/update/healthcheck</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>*.cfg</include>
                                            </includes>
                                            <excludes>
                                                <exclude>generated/*</exclude>
                                            </excludes>
                                            <targetPath>
                                                ${project.build.directory}/attach-resources/resources/update.healthcheck
                                            </targetPath>
                                        </resource>
                                        <resource>
                                            <directory>src/update/scripts</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>**/*</include>
                                            </includes>
                                            <excludes>
                                                <exclude>generated/*</exclude>
                                            </excludes>
                                            <targetPath>
                                                ${project.build.directory}/attach-resources/resources/update.scripts
                                            </targetPath>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>


        <profile>
            <id>prepare-process-attach</id>
            <activation>
                <file>
                    <exists>pom.xml</exists>
                </file>
            </activation>
            <build>
                <plugins>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <extensions>true</extensions>
                        <executions>
                            <execution>
                                <id>check-attaches</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                                 classpathref="maven.plugin.classpath"/>
                                        <if>
                                            <available file="${project.build.directory}/attach-resources/resources"
                                                       type="dir"/>
                                            <then>
                                                <property name="skip.attaches">false</property>
                                            </then>
                                            <else>
                                                <property name="skip.attaches">true</property>
                                            </else>
                                        </if>
                                    </target>
                                </configuration>
                            </execution>

                            <execution>
                                <id>concat-attach-lists</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <taskdef resource="net/sf/antcontrib/antlib.xml"
                                                 classpathref="maven.plugin.classpath"/>
                                        <if>
                                            <available file="${project.build.directory}/attach-resources" type="dir"/>
                                            <then>
                                                <for param="file">
                                                    <path>
                                                        <fileset dir="${project.build.directory}/attach-resources"
                                                                 includes="*.list" excludes="attach.list"/>
                                                    </path>
                                                    <sequential>
                                                        <concat destFile="${project.build.directory}/attach-resources/attach.list"
                                                                append="true">
                                                            <filelist dir="${project.build.directory}/attach-resources"
                                                                      files="@{file}"/>
                                                        </concat>
                                                        <concat destFile="${project.build.directory}/attach-resources/attach.list"
                                                                append="true">${path.separator}
                                                        </concat>
                                                    </sequential>
                                                </for>
                                                <if>
                                                    <available
                                                            file="${project.build.directory}/attach-resources/attach.list"
                                                            type="file"/>
                                                    <then>
                                                        <loadfile property="attaches.list"
                                                                  srcFile="${project.build.directory}/attach-resources/attach.list"/>
                                                        <property name="skip.attaches.1">false</property>
                                                    </then>
                                                    <else>
                                                        <property name="attaches.list">${path.separator}</property>
                                                        <property name="skip.attaches.1">true</property>
                                                    </else>
                                                </if>
                                            </then>
                                            <else>
                                                <property name="skip.attaches.1">true</property>
                                            </else>
                                        </if>
                                    </target>
                                </configuration>
                            </execution>


                            <!-- execution>
                                <id>load-attaches-list</id>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                      <skip>${skip.attaches}</skip>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <loadfile property="attaches.list" srcFile="${project.build.directory}/attach-resources/attach.list" />
                                        <echo>ATTACHES ::
                                            ${attaches.list}
                                        </echo>
                                    </target>
                                </configuration>
                            </execution -->
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.soebes.maven.plugins</groupId>
                        <artifactId>iterator-maven-plugin</artifactId>
                        <executions>

                            <execution>
                                <id>prepare-attaches-lists</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>iterator</goal>
                                </goals>
                                <configuration>
                                    <skip>${skip.attaches}</skip>
                                    <folder>${project.build.directory}/attach-resources/resources/</folder>
                                    <pluginExecutors>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <exportAntProperties>false</exportAntProperties>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <echo>--!!-- @item@ --!!--</echo>
                                                    <property name="item.type">@item@</property>
                                                    <pathconvert property="file.list.tmp">
                                                        <fileset
                                                                dir="${project.build.directory}/attach-resources/resources/${item.type}">
                                                            <include name="**"/>
                                                        </fileset>
                                                        <map from="${project.build.directory}/attach-resources/resources/"
                                                             to=""/>
                                                    </pathconvert>
                                                    <!-- echo>[file.list.tmp] ${file.list.tmp}</echo -->
                                                    <echo file="${project.build.directory}/attach-resources/${item.type}.list">
                                                        ${file.list.tmp}
                                                    </echo>
                                                    <replace
                                                            file="${project.build.directory}/attach-resources/${item.type}.list"
                                                            token="\" value="/"/>
                                                    <propertycopy name="current.defaults" from="${item.type}.defaults"/>
                                                    <echo file="${project.build.directory}/attach-resources/${item.type}.defaults">
                                                        ${current.defaults}
                                                    </echo>
                                                    <property
                                                            file="${project.build.directory}/attach-resources/${item.type}.defaults"/>
                                                    <delete file="${fragments.folder}/generated/fragments.xml"/>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                    </pluginExecutors>
                                </configuration>
                            </execution>


                            <execution>
                                <id>iterate-attaches</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>iterator</goal>
                                </goals>
                                <configuration>
                                    <skip>${skip.attaches}</skip>
                                    <content>${attaches.list}</content>
                                    <delimiter>${path.separator}</delimiter>
                                    <pluginExecutors>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <exportAntProperties>false</exportAntProperties>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <property name="item.current.local">@item@</property>
                                                    <echo>CURRENT :: ${item.current.local}</echo>
                                                    <propertyregex property="item.type.local"
                                                                   input="${item.current.local}" regexp="([^/]+)/(.*)$"
                                                                   select="\1"/>
                                                    <propertyregex property="file.path.local"
                                                                   input="${item.current.local}" regexp="([^/]+)/(.*)$"
                                                                   select="\2"/>
                                                    <basename property="file.name.ext.local" file="${file.path.local}"/>
                                                    <echo>:: ${item.type.local} :: ${file.path.local} ::
                                                        ${file.name.ext.local}
                                                    </echo>
                                                    <delete file="${project.build.directory}/attach-resources/current.defaults"/>
                                                    <copy file="${project.build.directory}/attach-resources/${item.type.local}.defaults"
                                                          toFile="${project.build.directory}/attach-resources/current.defaults"/>
                                                    <echo file="${project.build.directory}/attach-resources/current.defaults"
                                                          append="true">
                                                        ${line.separator}
                                                        item.current=${item.current.local}
                                                        item.type=${item.type.local}
                                                        file.path=${file.path.local}
                                                        file.name.ext=${file.name.ext.local}
                                                    </echo>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>

                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>properties-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>read-project-properties</goal>
                                            <configuration>
                                                <files>
                                                    <file>${project.build.directory}/attach-resources/current.defaults
                                                    </file>
                                                </files>
                                            </configuration>
                                        </pluginExecutor>

                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <exportAntProperties>false</exportAntProperties>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <echo>

                                                        LOADED DATA:

                                                        default.artifact.extension=${default.artifact.extension}
                                                        default.file.folder=${default.file.folder}
                                                        fragments.generate=${fragments.generate}
                                                        fragments.folder=${fragments.folder}
                                                    </echo>

                                                    <if>
                                                        <contains string="${file.name.ext}" substring="."/>
                                                        <then>
                                                            <propertyregex property="file.name" input="${file.name.ext}"
                                                                           regexp="(.*)\.(.+)$" select="\1"/>
                                                            <propertyregex property="file.ext" input="${file.name.ext}"
                                                                           regexp="(.*)\.(.+)$" select="\2"/>
                                                            <property name="artifact.extension" value="${file.ext}"/>
                                                        </then>
                                                        <else>
                                                            <property name="file.name" value="${file.name.ext}"/>
                                                            <property name="file.ext" value=""/>
                                                            <property name="artifact.extension"
                                                                      value="${default.artifact.extension}"/>
                                                        </else>
                                                    </if>
                                                    <if>
                                                        <contains string="${file.path}" substring="/"/>
                                                        <then>
                                                            <propertyregex property="file.folder" input="${file.path}"
                                                                           regexp="(.*)/(.+)$" select="\1"/>
                                                            <propertyregex property="file.folder.replaced"
                                                                           input="${file.folder}" regexp="/"
                                                                           replace="~"/>
                                                            <property name="artifact.classifier"
                                                                      value="${file.folder.replaced}~${file.name}"/>
                                                        </then>
                                                        <else>
                                                            <property name="file.folder"
                                                                      value="${default.file.folder}"/>
                                                            <property name="artifact.classifier" value="${file.name}"/>
                                                        </else>
                                                    </if>
                                                    <property name="filename.target" value="${file.name.ext}"/>
                                                    <echo file="${project.build.directory}/attach-resources/tmp/attach.properties">
                                                        filename.current=${filename.full}
                                                        fileext.current=${file.ext}
                                                        target.current=${filename.target}
                                                        folder.current=${file.folder}
                                                        classifier.current=${artifact.classifier}
                                                        extension.current=${artifact.extension}
                                                        path.current=${item.current}
                                                    </echo>
                                                    <if>
                                                        <equals arg1="${fragments.generate}" arg2="true"/>
                                                        <then>
                                                            <echo file="${fragments.folder}/generated/fragments.xml"
                                                                  append="true">
                                                                <![CDATA[
<!-- -->
<configfile finalname="${file.folder}/${filename.target}" override="true">
	mvn:${project.groupId}/${project.artifactId}/${project.version}/${artifact.extension}/${artifact.classifier}
</configfile>
<!-- -->
]]>
                                                            </echo>
                                                        </then>
                                                    </if>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>

                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>properties-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>read-project-properties</goal>
                                            <configuration>
                                                <files>
                                                    <file>
                                                        ${project.build.directory}/attach-resources/tmp/attach.properties
                                                    </file>
                                                </files>
                                            </configuration>
                                        </pluginExecutor>

                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>build-helper-maven-plugin</artifactId>
                                                <version>${build-helper-maven-plugin.version}</version>
                                            </plugin>
                                            <goal>attach-artifact</goal>
                                            <configuration>
                                                <artifacts>
                                                    <artifact>
                                                        <file>
                                                            ${project.build.directory}/attach-resources/resources/${path.current}
                                                        </file>
                                                        <type>${extension.current}</type>
                                                        <classifier>${classifier.current}</classifier>
                                                    </artifact>
                                                </artifacts>
                                            </configuration>
                                        </pluginExecutor>
                                    </pluginExecutors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <extensions>true</extensions>
                        <executions>
                        </executions>
                    </plugin-->


                </plugins>
            </build>
        </profile>
        <!--
        	END
			!!! attach management
		-->

        <!--
        BEGIN
        !!! update descriptor processing
        -->
        <profile>
            <id>process-update-descriptor</id>
            <activation>
                <file>
                    <exists>src/update/descriptor/descriptor.xml</exists>
                </file>
                <property>
                    <name>!skipUpdateDescriptor</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-update-xslt</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>ru.entaxy.esb.update-management</groupId>
                                            <artifactId>update-management-support</artifactId>
                                            <version>${project.version}</version>
                                            <type>xslt</type>
                                            <classifier>version-list</classifier>
                                            <overWrite>true</overWrite>
                                            <outputDirectory>${project.build.directory}/update/support</outputDirectory>
                                            <destFileName>version-list.xslt</destFileName>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>ru.entaxy.esb.update-management</groupId>
                                            <artifactId>update-management-support</artifactId>
                                            <version>${project.version}</version>
                                            <type>xslt</type>
                                            <classifier>install-plan</classifier>
                                            <overWrite>true</overWrite>
                                            <outputDirectory>${project.build.directory}/update/support</outputDirectory>
                                            <destFileName>install-plan.xslt</destFileName>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>ru.entaxy.esb.update-management</groupId>
                                            <artifactId>update-management-support</artifactId>
                                            <version>${project.version}</version>
                                            <type>xslt</type>
                                            <classifier>component-config</classifier>
                                            <overWrite>true</overWrite>
                                            <outputDirectory>${project.build.directory}/update/support</outputDirectory>
                                            <destFileName>component-config.xslt</destFileName>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>ru.entaxy.esb.update-management</groupId>
                                            <artifactId>update-management-support</artifactId>
                                            <version>${project.version}</version>
                                            <type>xslt</type>
                                            <classifier>component-name</classifier>
                                            <overWrite>true</overWrite>
                                            <outputDirectory>${project.build.directory}/update/support</outputDirectory>
                                            <destFileName>component-name.xslt</destFileName>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>ru.entaxy.esb.update-management</groupId>
                                            <artifactId>update-management-support</artifactId>
                                            <version>${project.version}</version>
                                            <type>xslt</type>
                                            <classifier>components-list</classifier>
                                            <overWrite>true</overWrite>
                                            <outputDirectory>${project.build.directory}/update/support</outputDirectory>
                                            <destFileName>components-list.xslt</destFileName>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>ru.entaxy.esb.update-management</groupId>
                                            <artifactId>update-management-support</artifactId>
                                            <version>${project.version}</version>
                                            <type>xslt</type>
                                            <classifier>repositories-list</classifier>
                                            <overWrite>true</overWrite>
                                            <outputDirectory>${project.build.directory}/update/support</outputDirectory>
                                            <destFileName>repositories-list.xslt</destFileName>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-update-desciptor</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <skip>${disable.attaches}</skip>
                                    <outputDirectory>${project.build.directory}/update/descriptor</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/update/descriptor</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>descriptor.xml</include>
                                            </includes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>xml-maven-plugin</artifactId>
                        <version>1.0.2</version>
                        <executions>
                            <execution>
                                <id>generate-version-component-repo-list</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>transform</goal>
                                </goals>
                                <configuration>
                                    <forceCreation>true</forceCreation>
                                    <transformationSets>
                                        <transformationSet>
                                            <dir>${project.build.directory}/update/descriptor</dir>
                                            <stylesheet>${project.build.directory}/update/support/version-list.xslt
                                            </stylesheet>
                                            <outputDir>${project.build.directory}/update/descriptor-processed
                                            </outputDir>
                                            <fileMappers>
                                                <fileMapper
                                                        implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
                                                    <targetExtension>.versions</targetExtension>
                                                </fileMapper>
                                            </fileMappers>
                                        </transformationSet>
                                        <transformationSet>
                                            <dir>${project.build.directory}/update/descriptor</dir>
                                            <stylesheet>${project.build.directory}/update/support/components-list.xslt
                                            </stylesheet>
                                            <outputDir>${project.build.directory}/update/descriptor-processed
                                            </outputDir>
                                            <fileMappers>
                                                <fileMapper
                                                        implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
                                                    <targetExtension>.components</targetExtension>
                                                </fileMapper>
                                            </fileMappers>
                                        </transformationSet>
                                        <transformationSet>
                                            <dir>${project.build.directory}/update/descriptor</dir>
                                            <stylesheet>
                                                ${project.build.directory}/update/support/repositories-list.xslt
                                            </stylesheet>
                                            <outputDir>${project.build.directory}/update/repositories/current
                                            </outputDir>
                                            <fileMappers>
                                                <fileMapper
                                                        implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
                                                    <targetExtension>.repositories</targetExtension>
                                                </fileMapper>
                                            </fileMappers>
                                        </transformationSet>
                                    </transformationSets>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>net.sf.saxon</groupId>
                                <artifactId>saxon</artifactId>
                                <version>8.7</version>
                            </dependency>
                        </dependencies>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <extensions>true</extensions>
                        <executions>
                            <execution>
                                <id>load-versions-list</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                                 classpathref="maven.plugin.classpath"/>
                                        <length file="${project.build.directory}/update/descriptor-processed/descriptor.versions"
                                                property="update.versions.file.length"/>
                                        <if>
                                            <equals arg1="${update.versions.file.length}" arg2="0"/>
                                            <then>
                                                <property name="skip.update.versions">true</property>
                                            </then>
                                            <else>
                                                <loadfile property="update.versions.list"
                                                          srcFile="${project.build.directory}/update/descriptor-processed/descriptor.versions"/>
                                                <property name="skip.update.versions">false</property>
                                            </else>
                                        </if>
                                        <echo>skip.update.versions :: ${skip.update.versions}</echo>
                                    </target>
                                </configuration>
                            </execution>
                            <execution>
                                <id>load-components-list</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                                 classpathref="maven.plugin.classpath"/>
                                        <length file="${project.build.directory}/update/descriptor-processed/descriptor.components"
                                                property="update.components.file.length"/>
                                        <if>
                                            <equals arg1="${update.components.file.length}" arg2="0"/>
                                            <then>
                                                <property name="skip.update.components">true</property>
                                            </then>
                                            <else>
                                                <loadfile property="update.components.list"
                                                          srcFile="${project.build.directory}/update/descriptor-processed/descriptor.components"/>
                                                <property name="skip.update.components">false</property>
                                            </else>
                                        </if>
                                        <echo>
                                            skip.update.versions :: ${skip.update.versions}
                                            skip.update.components :: ${skip.update.components}
                                        </echo>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.soebes.maven.plugins</groupId>
                        <artifactId>iterator-maven-plugin</artifactId>
                        <!-- configuration>
                            <skip>${skip.update.versions}</skip>
                        < /configuration -->
                        <executions>
                            <execution>
                                <id>generate-versions-plans</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>iterator</goal>
                                </goals>
                                <configuration>
                                    <skip>${skip.update.versions}</skip>
                                    <content>${update.versions.list}</content>
                                    <delimiter>;</delimiter>
                                    <pluginExecutors>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <exportAntProperties>false</exportAntProperties>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <property name="current.item">@item@</property>
                                                    <echo>::${current.item}::</echo>
                                                    <if>
                                                        <equals arg1="${current.item}" arg2="*" forcestring="true"/>
                                                        <then>
                                                            <property name="current.suf" value=""/>
                                                            <property name="current.fold" value="ANY"/>
                                                        </then>
                                                        <else>
                                                            <property name="current.suf" value=".${current.item}"/>
                                                            <property name="current.fold" value="${current.item}"/>
                                                        </else>
                                                    </if>
                                                    <echo file="${project.build.directory}/update/current.version">
                                                        current.version=${current.item}${line.separator}
                                                        current.suffix=${current.suf}
                                                        current.folder=${current.fold}
                                                    </echo>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>properties-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>read-project-properties</goal>
                                            <configuration>
                                                <files>
                                                    <file>${project.build.directory}/update/current.version</file>
                                                </files>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <exportAntProperties>false</exportAntProperties>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antlib.xml"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <echo>
                                                        current.version=${current.version}
                                                        current.suffix=${current.suffix}
                                                        current.folder=${current.folder}
                                                    </echo>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>xml-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>transform</goal>
                                            <configuration>
                                                <forceCreation>true</forceCreation>
                                                <transformationSets>
                                                    <transformationSet>
                                                        <dir>${project.build.directory}/update/descriptor</dir>
                                                        <stylesheet>
                                                            ${project.build.directory}/update/support/install-plan.xslt
                                                        </stylesheet>
                                                        <parameters>
                                                            <parameter>
                                                                <name>currentVersion</name>
                                                                <value>${current.version}</value>
                                                            </parameter>
                                                        </parameters>
                                                        <outputDir>
                                                            ${project.build.directory}/update/descriptor-processed/versions/${current.folder}
                                                        </outputDir>
                                                        <fileMappers>
                                                            <fileMapper
                                                                    implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
                                                                <targetExtension>.plan</targetExtension>
                                                            </fileMapper>
                                                        </fileMappers>
                                                    </transformationSet>
                                                </transformationSets>
                                                <transformerFactory>net.sf.saxon.TransformerFactoryImpl
                                                </transformerFactory>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <exportAntProperties>true</exportAntProperties>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antlib.xml"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <!-- replaceregexp file="${project.build.directory}/update/descriptor-processed/versions/${current.folder}/descriptor.plan"
                                                           match="\$"
                                                           replace="__DOLLAR__"
                                                           flags="g"
                                                           byline="true" / -->
                                                    <!-- replaceregexp file="${project.build.directory}/update/descriptor-processed/versions/${current.folder}/descriptor.plan"
                                                        match="\\n\\r"
                                                        replace="__LINE_SEP__"
                                                        flags="gs"
                                                        byline="false" / -->
                                                    <loadfile property="${project.artifactId}${current.suffix}.plan"
                                                              srcFile="${project.build.directory}/update/descriptor-processed/versions/${current.folder}/descriptor.plan">
                                                        <!-- filterchain>
                                                            <striplinebreaks />
                                                        </filterchain -->
                                                    </loadfile>
                                                    <echo>
                                                        ---
                                                        ${platform.plan}
                                                        ---
                                                        ${platform.1.8.2.plan}
                                                    </echo>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>

                                    </pluginExecutors>
                                </configuration>
                            </execution>
                            <execution>
                                <id>download-prepare-components-descriptors</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>iterator</goal>
                                </goals>
                                <configuration>
                                    <skip>${skip.update.components}</skip>
                                    <content>${update.components.list}</content>
                                    <delimiter>;</delimiter>
                                    <pluginExecutors>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <exportAntProperties>false</exportAntProperties>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antlib.xml"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <property name="current.component">@item@</property>
                                                    <echo>
                                                        current.component=${current.component}
                                                    </echo>
                                                    <propertyregex property="current.comp.groupId"
                                                                   input="${current.component}" regexp="(.+)/(.+)/(.+)"
                                                                   select="\1" global="true"/>
                                                    <propertyregex property="current.comp.artifactId"
                                                                   input="${current.component}" regexp="(.+)/(.+)/(.+)"
                                                                   select="\2" global="true"/>
                                                    <propertyregex property="current.comp.version"
                                                                   input="${current.component}" regexp="(.+)/(.+)/(.+)"
                                                                   select="\3" global="true"/>
                                                    <echo file="${project.build.directory}/update/current.component">
                                                        component.groupId=${current.comp.groupId}
                                                        component.artifactId=${current.comp.artifactId}
                                                        component.version=${current.comp.version}
                                                        component.folder=${current.comp.groupId}.${current.comp.artifactId}
                                                    </echo>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>properties-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>read-project-properties</goal>
                                            <configuration>
                                                <files>
                                                    <file>${project.build.directory}/update/current.component</file>
                                                </files>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <exportAntProperties>false</exportAntProperties>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antlib.xml"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <echo>
                                                        component.groupId=[${component.groupId}]
                                                        component.artifactId=[${component.artifactId}]
                                                        component.version=[${component.version}]
                                                        component.folder=[${component.folder}]
                                                    </echo>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-dependency-plugin</artifactId>
                                            </plugin>
                                            <goal>copy</goal>
                                            <configuration>
                                                <artifactItems>
                                                    <artifactItem>
                                                        <groupId>${component.groupId}</groupId>
                                                        <artifactId>${component.artifactId}</artifactId>
                                                        <version>${component.version}</version>
                                                        <type>xml</type>
                                                        <classifier>update-descriptor</classifier>
                                                        <overWrite>true</overWrite>
                                                        <outputDirectory>
                                                            ${project.build.directory}/update/components/${component.folder}
                                                        </outputDirectory>
                                                        <destFileName>descriptor.xml</destFileName>
                                                    </artifactItem>
                                                </artifactItems>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>xml-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>transform</goal>
                                            <configuration>
                                                <forceCreation>true</forceCreation>
                                                <transformationSets>
                                                    <transformationSet>
                                                        <dir>
                                                            ${project.build.directory}/update/components/${component.folder}
                                                        </dir>
                                                        <includes>
                                                            <include name="descriptor.xml">descriptor.xml</include>
                                                        </includes>
                                                        <stylesheet>
                                                            ${project.build.directory}/update/support/component-name.xslt
                                                        </stylesheet>
                                                        <outputDir>
                                                            ${project.build.directory}/update/components/${component.folder}
                                                        </outputDir>
                                                        <fileMappers>
                                                            <fileMapper
                                                                    implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
                                                                <targetExtension>.name</targetExtension>
                                                            </fileMapper>
                                                        </fileMappers>
                                                    </transformationSet>
                                                    <transformationSet>
                                                        <dir>
                                                            ${project.build.directory}/update/components/${component.folder}
                                                        </dir>
                                                        <includes>
                                                            <include name="descriptor.xml">descriptor.xml</include>
                                                        </includes>
                                                        <stylesheet>
                                                            ${project.build.directory}/update/support/component-config.xslt
                                                        </stylesheet>
                                                        <outputDir>
                                                            ${project.build.directory}/update/components/${component.folder}
                                                        </outputDir>
                                                        <fileMappers>
                                                            <fileMapper
                                                                    implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
                                                                <targetExtension>.config</targetExtension>
                                                            </fileMapper>
                                                        </fileMappers>
                                                    </transformationSet>
                                                    <transformationSet>
                                                        <dir>
                                                            ${project.build.directory}/update/components/${component.folder}
                                                        </dir>
                                                        <includes>
                                                            <include name="descriptor.xml">descriptor.xml</include>
                                                        </includes>
                                                        <stylesheet>
                                                            ${project.build.directory}/update/support/repositories-list.xslt
                                                        </stylesheet>
                                                        <outputDir>
                                                            ${project.build.directory}/update/repositories/${component.folder}
                                                        </outputDir>
                                                        <fileMappers>
                                                            <fileMapper
                                                                    implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
                                                                <targetExtension>.repositories</targetExtension>
                                                            </fileMapper>
                                                        </fileMappers>
                                                    </transformationSet>
                                                </transformationSets>
                                            </configuration>
                                        </pluginExecutor>
                                    </pluginExecutors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.soebes.maven.plugins</groupId>
                        <artifactId>iterator-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-generate-update-config</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>iterator</goal>
                                </goals>
                                <configuration>
                                    <skip>${skip.update.components}</skip>
                                    <folder>${project.build.directory}/update/components/</folder>
                                    <pluginExecutors>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <exportAntProperties>false</exportAntProperties>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antlib.xml"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <echo>
                                                        -- :: @item@ :: --
                                                    </echo>
                                                    <property name="componentFolder">@item@</property>
                                                    <loadfile property="component.name"
                                                              srcFile="${project.build.directory}/update/components/${componentFolder}/descriptor.name"/>
                                                    <echo file="${project.build.directory}/update/components/list">
                                                        ${component.name},
                                                    </echo>
                                                    <loadfile property="component.config"
                                                              srcFile="${project.build.directory}/update/components/${componentFolder}/descriptor.config"/>
                                                    <echo file="${project.build.directory}/update/components/config">
                                                        ${component.config}
                                                    </echo>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                    </pluginExecutors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>generate-update-config</id>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <taskdef resource="net/sf/antcontrib/antlib.xml"
                                                 classpathref="maven.plugin.classpath"/>
                                        <if>
                                            <available file="${project.build.directory}/update/components/list"
                                                       type="file"/>
                                            <then>
                                                <replaceregexp file="${project.build.directory}/update/components/list"
                                                               match=",\s*$" replace="${line.separator}"/>
                                                <echo file="${project.build.directory}/update/components/update.config">
                                                    components=
                                                </echo>
                                                <concat destfile="${project.build.directory}/update/components/update.config"
                                                        append="true">
                                                    <fileset file="${project.build.directory}/update/components/list"/>
                                                    <fileset
                                                            file="${project.build.directory}/update/components/config"/>
                                                </concat>
                                                <loadfile property="update.config.content"
                                                          srcFile="${project.build.directory}/update/components/update.config"/>
                                                <echo>
                                                    CONFIG CONTENT ::
                                                    ${update.config.content}
                                                </echo>
                                            </then>
                                        </if>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-update-descriptor</id>
                                <goals>
                                    <goal>attach-artifact</goal>
                                </goals>
                                <phase>prepare-package</phase>
                                <configuration>
                                    <artifacts>
                                        <artifact>
                                            <file>${project.build.directory}/update/descriptor/descriptor.xml</file>
                                            <type>xml</type>
                                            <classifier>update-descriptor</classifier>
                                        </artifact>
                                    </artifacts>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>


                </plugins>
            </build>
        </profile>
        <!--
        END
        !!! update descriptor processing
        -->

        <!--
        BEGIN
        !!! create resulting update KAR(s)
        -->
        <profile>
            <id>create-attach-update-kars</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>define-update-kar-skip</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <taskdef resource="net/sf/antcontrib/antlib.xml"
                                                 classpathref="maven.plugin.classpath"/>
                                        <if>
                                            <and>
                                                <!-- to ensure descriptor is aggregator -->
                                                <available file="${project.build.directory}/update/components"
                                                           type="dir"/>
                                                <!-- to ensure repositories exist -->
                                                <available file="${project.build.directory}/update/repositories"
                                                           type="dir"/>
                                            </and>
                                            <then>
                                                <property name="skip.update.kar" value="false"/>
                                            </then>
                                            <else>
                                                <property name="skip.update.kar" value="true"/>
                                                <property name="skip.attach.kar.final">true</property>
                                            </else>
                                        </if>
                                        <!-- echo>  === ITERATOR.SKIP :: ${iterator.skip}</echo -->
                                    </target>
                                </configuration>
                            </execution>
                            <execution>
                                <id>prepare-resulting-repo-list</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <skip>${skip.update.kar}</skip>
                                    <target>
                                        <taskdef resource="net/sf/antcontrib/antlib.xml"
                                                 classpathref="maven.plugin.classpath"/>
                                        <concat destfile="${project.build.directory}/update/repositories/list">
                                            <fileset dir="${project.build.directory}/update/repositories"
                                                     includes="*/*.repositories"/>
                                        </concat>
                                        <loadfile property="update.repo.list"
                                                  srcFile="${project.build.directory}/update/repositories/list"/>
                                    </target>
                                </configuration>
                            </execution>
                            <execution>
                                <id>assembly-final-kar</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <skip>${skip.update.kar}</skip>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <taskdef resource="net/sf/antcontrib/antlib.xml"
                                                 classpathref="maven.plugin.classpath"/>
                                        <if>
                                            <available file="${project.build.directory}/update/final-kar/contents"
                                                       type="dir"/>
                                            <then>
                                                <zip destfile="${project.build.directory}/update/final-kar/result.kar"
                                                     basedir="${project.build.directory}/update/final-kar/contents"
                                                     includes="**/*"/>
                                                <property name="skip.attach.kar.final">false</property>
                                            </then>
                                            <else>
                                                <property name="skip.attach.kar.final">true</property>
                                            </else>
                                        </if>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>com.soebes.maven.plugins</groupId>
                        <artifactId>iterator-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>download-unpack-kars</id>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>iterator</goal>
                                </goals>
                                <configuration>
                                    <skip>${skip.update.kar}</skip>
                                    <content>${update.repo.list}</content>
                                    <delimiter>;</delimiter>
                                    <pluginExecutors>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <exportAntProperties>false</exportAntProperties>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antlib.xml"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <property name="current.repo">@item@</property>
                                                    <propertyregex property="current.repo.groupId"
                                                                   input="${current.repo}"
                                                                   regexp="(.+)/(.+)/(.+)/(.+)/(.+)" select="\1"
                                                                   global="true"/>
                                                    <propertyregex property="current.repo.artifactId"
                                                                   input="${current.repo}"
                                                                   regexp="(.+)/(.+)/(.+)/(.+)/(.+)" select="\2"
                                                                   global="true"/>
                                                    <propertyregex property="current.repo.version"
                                                                   input="${current.repo}"
                                                                   regexp="(.+)/(.+)/(.+)/(.+)/(.+)" select="\3"
                                                                   global="true"/>
                                                    <propertyregex property="current.repo.type" input="${current.repo}"
                                                                   regexp="(.+)/(.+)/(.+)/(.+)/(.+)" select="\4"
                                                                   global="true"/>
                                                    <propertyregex property="current.repo.classifier"
                                                                   input="${current.repo}"
                                                                   regexp="(.+)/(.+)/(.+)/(.+)/(.+)" select="\5"
                                                                   global="true"/>
                                                    <echo file="${project.build.directory}/update/current.repo">
                                                        repo.groupId=${current.repo.groupId}
                                                        repo.artifactId=${current.repo.artifactId}
                                                        repo.version=${current.repo.version}
                                                        repo.type=${current.repo.type}
                                                        repo.classifier=${current.repo.classifier}
                                                    </echo>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>properties-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>read-project-properties</goal>
                                            <configuration>
                                                <files>
                                                    <file>${project.build.directory}/update/current.repo</file>
                                                </files>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-dependency-plugin</artifactId>
                                            </plugin>
                                            <goal>copy</goal>
                                            <configuration>
                                                <artifactItems>
                                                    <artifactItem>
                                                        <groupId>${repo.groupId}</groupId>
                                                        <artifactId>${repo.artifactId}</artifactId>
                                                        <version>${repo.version}</version>
                                                        <type>${repo.type}</type>
                                                        <classifier>${repo.classifier}</classifier>
                                                        <overWrite>true</overWrite>
                                                        <outputDirectory>${project.build.directory}/update/final-kar
                                                        </outputDirectory>
                                                        <destFileName>current.kar</destFileName>
                                                    </artifactItem>
                                                </artifactItems>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <exportAntProperties>false</exportAntProperties>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antlib.xml"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <echo>
                                                        === !!! UNPACK !!! ===
                                                        ${repo.groupId}/${repo.artifactId}/${repo.version}/${repo.type}/${repo.classifier}

                                                    </echo>
                                                    <unzip src="${project.build.directory}/update/final-kar/current.kar"
                                                           dest="${project.build.directory}/update/final-kar/contents"/>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                    </pluginExecutors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-result-kar</id>
                                <goals>
                                    <goal>attach-artifact</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <skipAttach>${skip.attach.kar.final}</skipAttach>
                                    <artifacts>
                                        <artifact>
                                            <file>${project.build.directory}/update/final-kar/result.kar</file>
                                            <type>kar</type>
                                            <classifier>final</classifier>
                                        </artifact>
                                    </artifacts>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- skip executing bundle-specific plugins -->
                    <plugin>
                        <groupId>org.apache.felix</groupId>
                        <artifactId>maven-bundle-plugin</artifactId>
                        <extensions>true</extensions>
                        <executions>
                            <execution>
                                <id>default-bundle</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-compile</id>
                                <phase>none</phase>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>default-testCompile</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-install-plugin</artifactId>
                        <configuration>
                            <skip>${skip.attach.kar.final}</skip>
                        </configuration>
                    </plugin>

                    <plugin>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <configuration>
                            <skip>${skip.attach.kar.final}</skip>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.karaf.tooling</groupId>
                        <artifactId>karaf-services-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>service-metadata-generate</id>
                                <phase>none</phase>
                                <goals>
                                    <goal>service-metadata-generate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-war</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- specially for woodstox -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <version>3.4.0</version>
                        <executions>
                            <execution>
                                <phase>none</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>
        <!--
        END
        !!! create resulting update KAR(s)
        -->


        <!--
        	BEGIN
			!!! versions management with maven-version-plugin
		-->
        <profile>
            <id>setVersion</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>set-version</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>set</goal>
                                </goals>
                                <configuration>
                                    <processAllModules>true</processAllModules>
                                    <processParent>true</processParent>
                                    <processFromLocalAggregationRoot>false</processFromLocalAggregationRoot>
                                </configuration>
                            </execution>
                            <execution>
                                <id>update-children</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>update-child-modules</goal>
                                </goals>
                                <configuration>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>removeSnapshot</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>parse-version</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>parse-version</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>set-version</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>set</goal>
                                    <!-- goal>update-child-modules</goal -->
                                </goals>
                                <configuration>
                                    <processAllModules>false</processAllModules>
                                    <processParent>true</processParent>
                                    <processFromLocalAggregationRoot>false</processFromLocalAggregationRoot>
                                    <newVersion>
                                        ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}
                                    </newVersion>
                                    <removeSnapshot>true</removeSnapshot>
                                </configuration>
                            </execution>
                            <execution>
                                <id>update-children</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>update-child-modules</goal>
                                </goals>
                                <configuration>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>nextSnapshot</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>parse-version</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>parse-version</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>set-version</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>set</goal>
                                </goals>
                                <configuration>
                                    <processAllModules>false</processAllModules>
                                    <processParent>true</processParent>
                                    <processFromLocalAggregationRoot>false</processFromLocalAggregationRoot>
                                    <!-- newVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.nextIncrementalVersion}-SNAPSHOT</newVersion -->
                                    <newVersion>
                                        ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}
                                    </newVersion>
                                    <nextSnapshot>true</nextSnapshot>
                                </configuration>
                            </execution>
                            <execution>
                                <id>update-children</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>update-child-modules</goal>
                                </goals>
                                <configuration>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>revert</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>versions-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <goals>
                                    <goal>revert</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!--
        	END
			!!! versions management with maven-version-plugin
		-->


        <!--

        BEGIN
        !!! Backup, deprecated, disabled, not used etc !!!

         -->

        <!--
        	@TO_VERIFY
        	@TODO verify
         -->
        <profile>
            <id>docker.reposilite</id>
            <distributionManagement>
                <repository>
                    <id>local-reposilte-releases</id>
                    <url>http://127.0.0.1:8081/releases</url>
                </repository>
                <snapshotRepository>
                    <id>local-reposilte-snapshots</id>
                    <url>http://127.0.0.1:8081/snapshots</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
        <!--
        	@TO_VERIFY
        	@TODO verify
         -->
        <profile>
            <id>docker.file.repo</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>entaxy-maven-repo-file</id>
                    <url>file:./temp/entaxy-docker/karaf/repo</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>

        <!--
        	@DISABLED @TO_REMOVE
        	@REPLACED_WITH attach-features
        	@TODO remove
         -->
        <profile>
            <id>features</id>
            <activation>
                <file>
                    <exists>src/main/features/features.xml.___</exists>
                </file>
            </activation>
            <build>
                <!-- resources>
                    <resource>
                        <directory>src/main/features</directory>
                        <filtering>true</filtering>
                        <includes>
                            <include>**/features.xml</include>
                        </includes>
                        <targetPath>${project.build.directory}/features</targetPath>
                    </resource>
                </resources -->
                <plugins>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-features</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/features</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main/features</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>**/features.xml</include>
                                            </includes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-features</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>attach-artifact</goal>
                                </goals>
                                <configuration>
                                    <artifacts>
                                        <artifact>
                                            <file>target/features/features.xml</file>
                                            <type>xml</type>
                                            <classifier>features</classifier>
                                        </artifact>
                                    </artifacts>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

        </profile>

        <profile>
            <id>cfg</id>
            <activation>
                <file>
                    <exists>src/main/cfg</exists>
                </file>
            </activation>
            <build>
                <resources>
                    <resource>
                        <directory>src/main/cfg</directory>
                        <targetPath>${project.build.directory}/cfg</targetPath>
                    </resource>
                </resources>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>collect-healthckeck-configs</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <pathconvert property="file.list.tmp">
                                            <fileset dir="${project.build.directory}/cfg">
                                                <include name="*.*"></include>
                                            </fileset>
                                        </pathconvert>
                                        <echo>[file.list.tmp] ${file.list.tmp}</echo>
                                        <echo file="${project.build.directory}/tmp/files">${file.list.tmp}</echo>
                                        <replace file="${project.build.directory}/tmp/files"
                                                 token="\"
                                                 value="\\\\"/>
                                        <loadfile property="file.list" srcFile="${project.build.directory}/tmp/files"/>
                                    </target>
                                </configuration>
                            </execution>

                            <!-- TO REMOVE -->
                            <!-- execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <echo>Displaying value of 'file.list' property</echo>
                                        <echo>[file.list] ${file.list}</echo>
                                    </target>
                                </configuration>
                            </execution -->

                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.soebes.maven.plugins</groupId>
                        <artifactId>iterator-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>iterate-healthcheck-configs</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>iterator</goal>
                                </goals>
                                <configuration>
                                    <content>${file.list}</content>
                                    <delimiter>${path.separator}</delimiter>
                                    <pluginExecutors>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <target>
                                                    <property name="item.current.cfg">@item@</property>
                                                    <basename property="filename.full" file="${item.current.cfg}"
                                                              suffix=".cfg"/>
                                                    <echo file="${project.build.directory}/tmp/properties">
                                                        filename.current=${filename.full}
                                                    </echo>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>

                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>properties-maven-plugin</artifactId>
                                                <version>1.0.0</version>
                                            </plugin>
                                            <goal>read-project-properties</goal>
                                            <configuration>
                                                <files>
                                                    <file>${project.build.directory}/tmp/properties</file>
                                                </files>
                                            </configuration>
                                        </pluginExecutor>

                                        <!-- TO REMOVE -->
                                        <!-- pluginExecutor>
                                          <plugin>
                                            <groupId>com.soebes.maven.plugins</groupId>
                                            <artifactId>maven-echo-plugin</artifactId>
                                            <version>0.1</version>
                                          </plugin>
                                          <goal>echo</goal>
                                          <configuration>
                                            <echos>
                                              <echo>This is a message: @item@</echo>
                                              <echo>This is a message: ${filename.current}</echo>
                                            </echos>
                                          </configuration>
                                        </pluginExecutor -->

                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>build-helper-maven-plugin</artifactId>
                                                <version>${build-helper-maven-plugin.version}</version>
                                            </plugin>
                                            <goal>attach-artifact</goal>
                                            <configuration>
                                                <artifacts>
                                                    <artifact>
                                                        <file>target/cfg/${filename.current}.cfg</file>
                                                        <type>cfg</type>
                                                        <classifier>${filename.current}</classifier>
                                                    </artifact>
                                                </artifacts>
                                            </configuration>
                                        </pluginExecutor>
                                    </pluginExecutors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!--
           @DISABLED @TO_REMOVE
           @REPLACED_WITH prepare-attaches-main
           @TODO remove
        -->
        <profile>
            <id>attach-features</id>
            <activation>
                <file>
                    <exists>src/main/features_</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-features</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/features</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main/features</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>*.xml</include>
                                            </includes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>collect-features-files</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <pathconvert property="features.list.tmp">
                                            <fileset dir="${project.build.directory}/features">
                                                <include name="*.*"/>
                                            </fileset>
                                        </pathconvert>
                                        <!-- echo>[file.list.tmp] ${file.list.tmp}</echo -->
                                        <echo file="${project.build.directory}/tmp/features">${features.list.tmp}</echo>
                                        <replace file="${project.build.directory}/tmp/features" token="\" value="\\\\"/>
                                        <loadfile property="features.list"
                                                  srcFile="${project.build.directory}/tmp/features"/>
                                        <delete file="src/main/features/generated/fragments.xml"/>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.soebes.maven.plugins</groupId>
                        <artifactId>iterator-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>iterate-features-files</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>iterator</goal>
                                </goals>
                                <configuration>
                                    <content>${features.list}</content>
                                    <delimiter>${path.separator}</delimiter>
                                    <pluginExecutors>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <target>
                                                    <property name="item.current">@item@</property>
                                                    <basename property="filename.full" file="${item.current}"
                                                              suffix=".xml"/>
                                                    <echo file="${project.build.directory}/tmp/features-properties">
                                                        filename.current=${filename.full}
                                                    </echo>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>properties-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>read-project-properties</goal>
                                            <configuration>
                                                <files>
                                                    <file>${project.build.directory}/tmp/features-properties</file>
                                                </files>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>build-helper-maven-plugin</artifactId>
                                                <version>${build-helper-maven-plugin.version}</version>
                                            </plugin>
                                            <goal>attach-artifact</goal>
                                            <configuration>
                                                <artifacts>
                                                    <artifact>
                                                        <file>target/features/${filename.current}.xml</file>
                                                        <type>xml</type>
                                                        <classifier>${filename.current}</classifier>
                                                    </artifact>
                                                </artifacts>
                                            </configuration>
                                        </pluginExecutor>
                                    </pluginExecutors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!--
           @DISABLED @TO_REMOVE
           @REPLACED_WITH prepare-attaches-main
           @TODO remove
        -->
        <profile>
            <id>attach-healthchecks</id>
            <activation>
                <file>
                    <exists>src/main/healthcheck_</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-healthchecks</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/healthcheck</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main/healthcheck</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>*.*</include>
                                            </includes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>collect-healthckeck-configs</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <pathconvert property="file.list.tmp">
                                            <fileset dir="${project.build.directory}/healthcheck">
                                                <include name="*.*"/>
                                            </fileset>
                                        </pathconvert>
                                        <!-- echo>[file.list.tmp] ${file.list.tmp}</echo -->
                                        <echo file="${project.build.directory}/tmp/files">${file.list.tmp}</echo>
                                        <replace file="${project.build.directory}/tmp/files" token="\" value="\\\\"/>
                                        <loadfile property="file.list" srcFile="${project.build.directory}/tmp/files"/>
                                        <delete file="src/main/healthcheck/generated/fragments.xml"/>
                                    </target>
                                </configuration>
                            </execution>

                            <!-- TO REMOVE -->
                            <!-- execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <echo>Displaying value of 'file.list' property</echo>
                                        <echo>[file.list] ${file.list}</echo>
                                    </target>
                                </configuration>
                            </execution -->

                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.soebes.maven.plugins</groupId>
                        <artifactId>iterator-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>iterate-healthcheck-configs</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>iterator</goal>
                                </goals>
                                <configuration>
                                    <content>${file.list}</content>
                                    <delimiter>${path.separator}</delimiter>
                                    <pluginExecutors>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <target>
                                                    <property name="item.current">@item@</property>
                                                    <basename property="filename.full" file="${item.current}"
                                                              suffix=".cfg"/>
                                                    <echo file="${project.build.directory}/tmp/properties">
                                                        filename.current=${filename.full}
                                                    </echo>
                                                    <echo file="src/main/healthcheck/generated/fragments.xml"
                                                          append="true">
                                                        <![CDATA[
<!-- -->
<configfile finalname="${karaf.etc}/${filename.full}.cfg" override="true">
	mvn:${project.groupId}/${project.artifactId}/${project.version}/cfg/${filename.full}
</configfile>
<!-- -->
											]]>
                                                    </echo>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>properties-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>read-project-properties</goal>
                                            <configuration>
                                                <files>
                                                    <file>${project.build.directory}/tmp/properties</file>
                                                </files>
                                            </configuration>
                                        </pluginExecutor>

                                        <!-- TO REMOVE -->
                                        <!-- pluginExecutor>
                                          <plugin>
                                            <groupId>com.soebes.maven.plugins</groupId>
                                            <artifactId>maven-echo-plugin</artifactId>
                                            <version>0.1</version>
                                          </plugin>
                                          <goal>echo</goal>
                                          <configuration>
                                            <echos>
                                              <echo>This is a message: @item@</echo>
                                              <echo>This is a message: ${filename.current}</echo>
                                            </echos>
                                          </configuration>
                                        </pluginExecutor -->

                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>build-helper-maven-plugin</artifactId>
                                                <version>${build-helper-maven-plugin.version}</version>
                                            </plugin>
                                            <goal>attach-artifact</goal>
                                            <configuration>
                                                <artifacts>
                                                    <artifact>
                                                        <file>src/main/healthcheck/${filename.current}.cfg</file>
                                                        <type>cfg</type>
                                                        <classifier>${filename.current}</classifier>
                                                    </artifact>
                                                </artifacts>
                                            </configuration>
                                        </pluginExecutor>
                                    </pluginExecutors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!--
           @DISABLED @TO_REMOVE
           @REPLACED_WITH prepare-attaches-main
           @TODO remove
        -->
        <profile>
            <id>attach-scripts</id>
            <activation>
                <file>
                    <exists>src/main/scripts_</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-scripts</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/scripts</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main/scripts</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>**/*</include>
                                                <exclude>generated/*</exclude>
                                            </includes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>collect-scripts</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <exportAntProperties>true</exportAntProperties>
                                    <target>
                                        <pathconvert property="scripts.list.tmp">
                                            <fileset dir="${project.build.directory}/scripts">
                                                <include name="**/*"/>
                                                <exclude name="generated/*"/>
                                            </fileset>
                                            <map from="${project.build.directory}/scripts/" to=""/>
                                        </pathconvert>
                                        <!-- echo>[file.list.tmp] ${file.list.tmp}</echo -->
                                        <echo file="${project.build.directory}/tmp/scripts">${scripts.list.tmp}</echo>
                                        <replace file="${project.build.directory}/tmp/scripts" token="\" value="/"/>
                                        <loadfile property="scripts.list"
                                                  srcFile="${project.build.directory}/tmp/scripts"/>
                                        <delete file="src/main/scripts/generated/fragments.xml"/>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.soebes.maven.plugins</groupId>
                        <artifactId>iterator-maven-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>iterate-scripts</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>iterator</goal>
                                </goals>
                                <configuration>
                                    <content>${scripts.list}</content>
                                    <delimiter>${path.separator}</delimiter>
                                    <pluginExecutors>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-antrun-plugin</artifactId>
                                            </plugin>
                                            <goal>run</goal>
                                            <configuration>
                                                <target>
                                                    <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                                             classpathref="maven.plugin.classpath"/>
                                                    <property name="item.current">@item@</property>
                                                    <!-- echo> CURRENT :: ${item.current}</echo -->
                                                    <basename property="filename.full.ext" file="${item.current}"/>
                                                    <if>
                                                        <contains string="${filename.full.ext}" substring="."/>
                                                        <then>
                                                            <propertyregex property="filename.full"
                                                                           input="${filename.full.ext}"
                                                                           regexp="(.*)\.(.+)$" select="\1"/>
                                                            <propertyregex property="filename.ext"
                                                                           input="${filename.full.ext}"
                                                                           regexp="(.*)\.(.+)$" select="\2"/>
                                                            <property name="artifact.extension"
                                                                      value="${filename.ext}"/>
                                                        </then>
                                                        <else>
                                                            <property name="filename.full"
                                                                      value="${filename.full.ext}"/>
                                                            <property name="filename.ext" value=""/>
                                                            <property name="artifact.extension" value="script"/>
                                                        </else>
                                                    </if>
                                                    <if>
                                                        <contains string="${item.current}" substring="/"/>
                                                        <then>
                                                            <propertyregex property="file.folder"
                                                                           input="${item.current}" regexp="(.*)/(.+)$"
                                                                           select="\1"/>
                                                            <propertyregex property="file.folder.replaced"
                                                                           input="${file.folder}" regexp="/"
                                                                           replace="~"/>
                                                            <property name="artifact.classifier"
                                                                      value="${file.folder.replaced}~${filename.full}"/>
                                                        </then>
                                                        <else>
                                                            <property name="file.folder" value="scripts"/>
                                                            <property name="artifact.classifier"
                                                                      value="${filename.full}"/>
                                                        </else>
                                                    </if>
                                                    <property name="filename.target" value="${filename.full.ext}"/>
                                                    <echo file="${project.build.directory}/tmp/scripts.properties">
                                                        filename.current=${filename.full}
                                                        fileext.current=${filename.ext}
                                                        target.current=${filename.target}
                                                        folder.current=${file.folder}
                                                        classifier.current=${artifact.classifier}
                                                        extension.current=${artifact.extension}
                                                        path.current=${item.current}
                                                    </echo>
                                                    <echo file="src/main/scripts/generated/fragments.xml" append="true">
                                                        <![CDATA[
<!-- -->
<configfile finalname="${file.folder}/${filename.target}" override="true">
	mvn:${project.groupId}/${project.artifactId}/${project.version}/${artifact.extension}/${artifact.classifier}
</configfile>
<!-- -->
											]]>
                                                    </echo>
                                                </target>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>properties-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>read-project-properties</goal>
                                            <configuration>
                                                <files>
                                                    <file>${project.build.directory}/tmp/scripts.properties</file>
                                                </files>
                                            </configuration>
                                        </pluginExecutor>

                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>build-helper-maven-plugin</artifactId>
                                                <version>${build-helper-maven-plugin.version}</version>
                                            </plugin>
                                            <goal>attach-artifact</goal>
                                            <configuration>
                                                <artifacts>
                                                    <artifact>
                                                        <file>${project.build.directory}/scripts/${path.current}</file>
                                                        <type>${extension.current}</type>
                                                        <classifier>${classifier.current}</classifier>
                                                    </artifact>
                                                </artifacts>
                                            </configuration>
                                        </pluginExecutor>
                                    </pluginExecutors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>


        <!--

        END
        !!! Backup, deprecated, disabled, not used etc !!!

         -->


    </profiles>

    <scm>
        <connection>scm:git:https://git.emdev.ru/entaxy/entaxy-framework</connection>
    </scm>

</project>
