<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>ru.entaxy.esb</groupId>
        <artifactId>root</artifactId>
        <version>1.8.0</version>
    </parent>

    <artifactId>karaf-features</artifactId>
    <name>SYSTEM :: ENTAXY :: Features</name>
    <packaging>pom</packaging>

    <profiles>
        <profile>
            <id>cfg.dev</id>
            <properties>
                <environmentConfigurationDirectory>cfg</environmentConfigurationDirectory>
            </properties>
            <build>
                <resources>
                    <resource>
                        <directory>src/main/${environmentConfigurationDirectory}</directory>
                        <filtering>true</filtering>
                        <targetPath>${project.build.directory}/cfg</targetPath>
                    </resource>
                </resources>
            </build>
            <activation>
                <property>
                    <name>!skipDevConfig</name>
                </property>
            </activation>
        </profile>
        <profile>
            <id>cfg.local</id>
            <properties>
                <environmentConfigurationDirectory>cfg.local</environmentConfigurationDirectory>
            </properties>
        </profile>
    </profiles>

    <build>
        <resources>
            <resource>
                <directory>src/main/feature</directory>
                <filtering>true</filtering>
                <targetPath>${project.build.directory}/feature</targetPath>
            </resource>
            <resource>
                <directory>src/main/script</directory>
                <filtering>true</filtering>
                <targetPath>${project.build.directory}/script</targetPath>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.12</version>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>target/feature/feature.xml</file>
                                    <type>xml</type>
                                    <classifier>features</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.system.basic_auth.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.system.basic_auth</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.system.basic_auth.htpasswd.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.system.basic_auth.htpasswd</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.system.event.rest.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.system.event.rest</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.system.event.handler.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.system.event.handler</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/org.ops4j.datasource-entaxy.esb.cache.cfg</file>
                                    <type>cfg</type>
                                    <classifier>datasource-cache</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/org.ops4j.datasource-entaxy.esb.storage.cfg</file>
                                    <type>cfg</type>
                                    <classifier>datasource-storage</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.deployer.nexus.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.deployer.nexus</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.deployer.cellar.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.deployer.cellar</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/script/install.karaf</file>
                                    <type>script</type>
                                    <classifier>install</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.error.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.error</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.error.code.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.error.code</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.error.text.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.error.text</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.deployer.file.system.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.deployer.file.system</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.system.schema.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.system.schema</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/ru.entaxy.esb.system.management.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.system.management</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/cfg/jre.properties</file>
                                    <type>properties</type>
                                    <classifier>jre</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
