<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.11.1</version>
    </parent>
    <groupId>ru.entaxy.ion</groupId>
    <artifactId>entaxy-ion-distribution</artifactId>
    <packaging>pom</packaging>
    <name>ENTAXY :: ION :: DISTRIBUTION</name>
    <description>Entaxy ION distribution parent</description>

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

    <properties>

        <hibernate.validator.version>6.1.5.Final</hibernate.validator.version>
        <openjpa.version>3.1.1</openjpa.version>
        <pax.jdbc.version>1.4.4</pax.jdbc.version>
        <aries.jpa.version>2.7.2</aries.jpa.version>
        <pax.cdi.version>1.1.3</pax.cdi.version>
        <pax.jms.version>1.0.7</pax.jms.version>
        <pax.transx.version>0.4.4</pax.transx.version>

        <!-- @TODO set to ${artemis.version} after raise on root/pom.xml -->
        <artemis.onboard.version>2.19.0</artemis.onboard.version>

        <entaxy.underlying.version>${project.version}</entaxy.underlying.version>
        <entaxy.platform.version>${project.version}</entaxy.platform.version>
        <entaxy.ui.version>${project.version}</entaxy.ui.version>
        <entaxy.ui.hawtio.version>${project.version}</entaxy.ui.hawtio.version>

        <entaxy.documentation.version>1.11.0</entaxy.documentation.version>
<!--        <camel.documentation.version>3.4.x.entaxy</camel.documentation.version>-->

    </properties>

    <modules>

        <module>entaxy-ion-karaf-dist</module>
        <module>entaxy-ion-platform-dist</module>
        <module>entaxy-ion-assembly-dist</module>

    </modules>

    <profiles>
        <!-- begin of 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>true</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 of maven-version-plugin -->

        <profile>
            <id>public-deploy-entaxy-ion</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <distributionManagement>
                <repository>
                    <id>entaxy-public-entaxy</id>
                    <name>entaxy-public-entaxy</name>
                    <uniqueVersion>false</uniqueVersion>
                    <layout>default</layout>
                    <url>https://nexus.entaxy.ru/nexus/repository/entaxy-public-ion/</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>
    </profiles>
</project>
