<?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>examples</artifactId>
    <version>5.2.2</version>

    <packaging>pom</packaging>

    <properties>
        <tycho-version>1.6.0</tycho-version>

        <!-- SCM: Note that we are in the "kura" sub-dir here already -->
        <tycho.scmUrl>scm:git:ssh://github.com/eclipse/kura/kura</tycho.scmUrl>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
        <kura.basedir>${project.basedir}/..</kura.basedir>
        <kura.build.version>${maven.build.timestamp}</kura.build.version>

        <skip.can.example>true</skip.can.example>

        <osgi-dp-plugin-version>0.3.0</osgi-dp-plugin-version>
        <check.plugins.exist.remote>false</check.plugins.exist.remote>
    </properties>

    <distributionManagement>
        <repository>
            <id>repo.eclipse.org</id>
            <name>Eclipse Kura Repository - Releases</name>
            <url>https://repo.eclipse.org/content/repositories/kura-releases/</url>
        </repository>
        <snapshotRepository>
            <id>repo.eclipse.org</id>
            <name>Eclipse Kura Repository - Snapshots</name>
            <url>https://repo.eclipse.org/content/repositories/kura-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <modules>
        <module>org.eclipse.kura.demo.heater</module>
        <module>org.eclipse.kura.demo.modbus</module>
        <module>org.eclipse.kura.example.project</module>
        <module>org.eclipse.kura.example.publisher</module>
        <module>org.eclipse.kura.example.serial.publisher</module>
        <module>org.eclipse.kura.example.gpio</module>
        <module>org.eclipse.kura.example.ble.tisensortag</module>
        <module>org.eclipse.kura.example.ble.tisensortag.dbus</module>
        <module>org.eclipse.kura.example.beacon</module>
        <module>org.eclipse.kura.example.beacon.scanner</module>
        <module>org.eclipse.kura.example.ibeacon.advertiser</module>
        <module>org.eclipse.kura.example.ibeacon.scanner</module>
        <module>org.eclipse.kura.example.eddystone.advertiser</module>
        <module>org.eclipse.kura.example.eddystone.scanner</module>
        <module>org.eclipse.kura.example.camel.quickstart</module>
        <module>org.eclipse.kura.example.camel.publisher</module>
        <module>org.eclipse.kura.example.camel.aggregation</module>
        <module>org.eclipse.kura.raspberrypi.sensehat</module>
        <module>org.eclipse.kura.raspberrypi.sensehat.example</module>
        <module>org.eclipse.kura.example.wire.logic.multiport.provider</module>
        <module>org.eclipse.kura.example.wire.math.multiport.provider</module>
        <module>org.eclipse.kura.example.wire.math.singleport.provider</module>
        <module>org.eclipse.kura.example.wire.math.trig</module>
        <module>org.eclipse.kura.example.driver.sensehat</module>
        <module>org.eclipse.kura.wire.devel.component.provider</module>
        <module>org.eclipse.kura.example.web.extension</module>
        <module>org.eclipse.kura.example.gpio.led</module>
        <module>org.eclipse.kura.example.tamper.detection</module>
        <module>org.eclipse.kura.example.rest.authentication.provider</module>
        <module>test</module>
    </modules>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <property>
                    <name>!kura.osgi</name>
                </property>
            </activation>
            <repositories>
                <repository>
                    <id>p2-repo-equinox_3.16.0</id>
                    <layout>p2</layout>
                    <url>file:///${kura.basedir}/target-definition/equinox_3.16.0/repository/</url>
                </repository>
            </repositories>
        </profile>
        <profile>
            <id>equinox</id>
            <activation>
                <property>
                    <name>kura.osgi</name>
                    <value>equinox</value>
                </property>
            </activation>
            <repositories>
                <repository>
                    <id>p2-repo-equinox_3.16.0</id>
                    <layout>p2</layout>
                    <url>file:///${kura.basedir}/target-definition/equinox_3.16.0/repository/</url>
                </repository>
            </repositories>
        </profile>
        <profile>
            <id>bree</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eclipse.tycho</groupId>
                        <artifactId>tycho-compiler-plugin</artifactId>
                        <version>${tycho-version}</version>
                        <configuration>
                            <useJDK>BREE</useJDK>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>can</id>
            <activation>
                <property>
                    <name>skip.can.example</name>
                    <value>false</value>
                </property>
            </activation>
            <modules>
                <module>org.eclipse.kura.example.can</module>
            </modules>
        </profile>
        <profile>
            <id>check-exists-plugin</id>
            <properties>
                <check.plugins.exist.remote>true</check.plugins.exist.remote>
            </properties>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>p2-repo-common</id>
            <layout>p2</layout>
            <url>file:///${kura.basedir}/target-definition/common/repository/</url>
        </repository>
    </repositories>

    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>1.0-beta-6</version>
            </extension>
        </extensions>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>
                <dependencies>
                    <dependency>
                        <groupId>org.slf4j</groupId>
                        <artifactId>jcl-over-slf4j</artifactId>
                        <version>1.7.5</version>
                    </dependency>
                    <dependency>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-jdk14</artifactId>
                        <version>1.7.5</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>${kura.basedir}/../checkstyle_checks.xml</configLocation>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <findbugsXmlOutput>true</findbugsXmlOutput>
                    <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
                    <xmlOutput>true</xmlOutput>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.1</version>
                <configuration>
                    <skip>false</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>target-platform-configuration</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <environments>
                        <environment>
                            <os>win32</os>
                            <ws>win32</ws>
                            <arch>x86</arch>
                        </environment>
                        <environment>
                            <os>linux</os>
                            <ws>gtk</ws>
                            <arch>x86</arch>
                        </environment>
                    </environments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho-version}</version>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-packaging-plugin</artifactId>
                <configuration>
                    <sourceReferences>
                        <generate>true</generate>
                    </sourceReferences>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.eclipse.tycho.extras</groupId>
                        <artifactId>tycho-sourceref-jgit</artifactId>
                        <version>${tycho-version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-compiler-plugin</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <!-- make us aware of warnings -->
                    <showWarnings>true</showWarnings>
                    <!-- Kura does not set bootdelegation, we let the compiler check for this -->
                    <requireJREPackageImports>true</requireJREPackageImports>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-source-plugin</artifactId>
                <version>${tycho-version}</version>
                <executions>
                    <execution>
                        <id>plugin-source</id>
                        <goals>
                            <goal>plugin-source</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-surefire-plugin</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <providerHint>junit4</providerHint>
                    <argLine>${jacocoArgs} -Deurotech.framework.mode=emulator -Dds.showtrace=true</argLine>
                    <dependencies>
                        <dependency>
                            <type>p2-installable-unit</type>
                            <artifactId>org.eclipse.equinox.ds</artifactId>
                        </dependency>
                    </dependencies>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.3</version>
            </plugin>
            <plugin>
                <!-- license:format to add license:check to check -->
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <header>distrib/eclipse_license.txt</header>
                    <properties>
                        <owner>Eurotech and/or its affiliates</owner>
                        <contributor>Eurotech</contributor>
                        <dates>2011, 2014</dates>
                    </properties>
                    <includes>
                        <include>**/*.java</include>
                        <include>**/*.properties</include>
                        <include>**/*.sh</include>
                        <include>**/*.xml</include>
                        <include>**/denali.css</include>
                        <include>**/.conf</include>
                    </includes>
                    <mapping>
                        <conf>SCRIPT_STYLE</conf>
                    </mapping>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <id>verify-jdeps</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <exportAntProperties>true</exportAntProperties>
                            <target name="verify.jdeps">
                                <available file="jdeps"
                                    filepath="${env.PATH}" property="jdeps.present" />
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>de.dentrassi.maven</groupId>
                <artifactId>osgi-dp</artifactId>
                <version>${osgi-dp-plugin-version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.honton.chas</groupId>
                <artifactId>exists-maven-plugin</artifactId>
                <version>0.0.3</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.eclipse.tycho</groupId>
                    <artifactId>tycho-packaging-plugin</artifactId>
                    <version>${tycho-version}</version>
                    <configuration>
                        <strictVersions>true</strictVersions>
                        <format>${kura.build.version}</format>
                    </configuration>
                </plugin>

                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</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>
