<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright (c) 2011, 2023 Eurotech and/or its affiliates and others
  
    This program and the accompanying materials are made
    available under the terms of the Eclipse Public License 2.0
    which is available at https://www.eclipse.org/legal/epl-2.0/
 
    SPDX-License-Identifier: EPL-2.0
 
    Contributors:
     Eurotech
     Red Hat Inc
-->
<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>
    <groupId>org.eclipse.kura</groupId>
    <artifactId>target-platform</artifactId>
    <version>5.4.0</version>

    <packaging>pom</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <check.plugins.exist.remote>false</check.plugins.exist.remote>
        <kura.addons.url>https://raw.github.com/eurotech/kura_addons/mvn-repo/</kura.addons.url>
        <skip.libsocket-can>true</skip.libsocket-can>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <!-- plugins versions common to Java 8 and Java 17 builds -->
        <exists-maven-plugin.version>0.0.3</exists-maven-plugin.version>
        <lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
        <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
        <maven-bundle-plugin.version>5.1.8</maven-bundle-plugin.version>
        <maven-clean-plugin.version>2.4.1</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
        <maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
        <maven-dependency-plugin.version>3.0.0</maven-dependency-plugin.version>
        <maven-deploy-plugin.version>2.8.1</maven-deploy-plugin.version>
        <maven-site-plugin.version>3.3</maven-site-plugin.version>
        <maven-surefire-plugin.version>2.7.2</maven-surefire-plugin.version>
        <properties-maven-plugin.version>1.0-alpha-2</properties-maven-plugin.version>
    </properties>

    <modules>
        <module>org.apache.activemq.artemis</module>
        <module>org.eclipse.kura.camel.sun.misc</module>
        <module>org.eclipse.kura.sun.misc</module>
        <module>com.codeminders.hidapi-parent</module>
        <module>org.usb4java</module>
        <module>usb4java-javax</module>
        <module>org.moka7</module>
        <module>org.eclipse.soda.dk.comm-parent</module>
        <module>jdk.dio-parent</module>
        <module>com.gwt.user</module>
        <module>moquette-broker</module>
        <module>log4j2-api-config</module>
        <module>org.eclipse.kura.jetty.customizer</module>
        <module>p2-repo-common</module>
        <module>p2-repo-equinox_3.16.0</module>
        <module>p2-repo-test-deps</module>
    </modules>

    <repositories>
        <repository>
            <id>Kura Releases</id>
            <name>Kura Repository - Releases</name>
            <url>https://repo.eclipse.org/content/repositories/kura-releases/</url>
        </repository>
        <repository>
            <id>Kura Snapshots</id>
            <name>Kura Repository - Snapshots</name>
            <url>https://repo.eclipse.org/content/repositories/kura-snapshots/</url>
        </repository>
        <repository>
            <id>kura_addons</id>
            <name>Kura Addons Maven Repository</name>
            <url>${kura.addons.url}</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>Eclipse Paho Repo</id>
            <url>https://repo.eclipse.org/content/repositories/paho-releases/</url>
        </repository>
    </repositories>

    <distributionManagement>
        <repository>
            <id>repo.eclipse.org</id>
            <name>Kura Repository - Releases</name>
            <url>https://repo.eclipse.org/content/repositories/kura-releases/</url>
        </repository>
        <snapshotRepository>
            <id>repo.eclipse.org</id>
            <name>Kura Repository - Snapshots</name>
            <url>https://repo.eclipse.org/content/repositories/kura-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
    
    <profiles>
        <profile>
            <id>java8</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <properties>
                <tycho-p2-extras-plugin.version>1.7.0</tycho-p2-extras-plugin.version>
            </properties>
        </profile>
        <profile>
            <id>java17</id>
            <activation>
                <jdk>17</jdk>
            </activation>
            <properties>
                <tycho-p2-extras-plugin.version>3.0.1</tycho-p2-extras-plugin.version>
            </properties>
        </profile>
        <profile>
            <id>can</id>
            <activation>
                <property>
                    <name>skip.libsocket-can</name>
                    <value>false</value>
                </property>
            </activation>
            <modules>
                <module>org.eclipse.kura.libsocket-can-osgi</module>
            </modules>
        </profile>
        <profile>
            <id>check-exists-plugin</id>
            <properties>
            	<check.plugins.exist.remote>true</check.plugins.exist.remote>
            </properties>
        </profile>
    </profiles>

    <pluginRepositories>
        <pluginRepository>
            <id>dash-licenses-snapshots</id>
            <url>https://repo.eclipse.org/content/repositories/dash-licenses-snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${maven-site-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin.version}</version>
                <configuration>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.slf4j</groupId>
                        <artifactId>jcl-over-slf4j</artifactId>
                        <version>1.7.36</version>
                    </dependency>
                    <dependency>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-jdk14</artifactId>
                        <version>1.7.36</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>checkstyle-validation</id>
                        <phase>process-sources</phase>
                        <configuration>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <linkXRef>false</linkXRef>
                            <configLocation>../checkstyle_checks.xml</configLocation>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.honton.chas</groupId>
                <artifactId>exists-maven-plugin</artifactId>
                <version>${exists-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>remote</goal>
                        </goals>
                        <configuration>
                            <skipIfSnapshot>true</skipIfSnapshot>
                            <failIfExists>${check.plugins.exist.remote}</failIfExists>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>${maven-bundle-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>${lifecycle-mapping.version}</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.jacoco
                                        </groupId>
                                        <artifactId>
                                            jacoco-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [0.6.4.201312101107,)
                                        </versionRange>
                                        <goals>
                                            <goal>
                                                prepare-agent
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-dependency-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.1,)
                                        </versionRange>
                                        <goals>
                                            <goal>
                                                copy-dependencies
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-antrun-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.7,)
                                        </versionRange>
                                        <goals>
                                            <goal>run</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.codehaus.mojo
                                        </groupId>
                                        <artifactId>
                                            build-helper-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.9,)
                                        </versionRange>
                                        <goals>
                                            <goal>regex-property</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-checkstyle-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.14,)
                                        </versionRange>
                                        <goals>
                                            <goal>check</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.codehaus.mojo
                                        </groupId>
                                        <artifactId>
                                            exec-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.2,)
                                        </versionRange>
                                        <goals>
                                            <goal>exec</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
