<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 https://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.10.1</version>
    </parent>
    <groupId>ru.entaxy</groupId>
    <artifactId>platform-provided-modules</artifactId>
    <packaging>pom</packaging>
    <name>ENTAXY :: PLATFORM PROVIDED MODULES</name>
    <description>ENTAXY :: PLATFORM PROVIDED MODULES</description>

    <build>

        <resources>
            <resource>
                <directory>src/main/provided</directory>
                <filtering>true</filtering>
                <targetPath>${project.build.directory}/provided</targetPath>
            </resource>
            <resource>
                <directory>src/main/support</directory>
                <filtering>true</filtering>
                <targetPath>${project.build.directory}/support</targetPath>
            </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>attach-provided</id>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <artifacts>
                        <artifact>
                            <file>${project.build.directory}/provided/ui.xml
                            </file>
                            <type>xml</type>
                            <classifier>ui</classifier>
                        </artifact>
                        <artifact>
                            <file>${project.build.directory}/support/ui/collect-ui-features.xslt
                            </file>
                            <type>xslt</type>
                            <classifier>collect-ui-features</classifier>
                        </artifact>
                        <artifact>
                            <file>${project.build.directory}/support/ui/process-ui-modules.xslt
                            </file>
                            <type>xslt</type>
                            <classifier>process-ui-modules</classifier>
                        </artifact>
                    </artifacts>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-install-plugin</artifactId>
                <executions>
                    <execution>
                        <id>install-provided-modules-data</id>
                        <phase>package</phase>
                        <goals>
                            <goal>install-file</goal>
                        </goals>
                        <configuration>
                            <groupId>${platform.provided.groupId}</groupId>
                            <artifactId>${platform.provided.data.artifactId}</artifactId>
                            <version>${project.version}</version>
                            <classifier>ui</classifier>
                            <packaging>xml</packaging>
                            <generatePom>false</generatePom>
                            <file>${project.build.directory}/provided/ui.xml</file>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

</project>
