<?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>

    <artifactId>flow-osgi-project</artifactId>
    <name>Flow OSGi</name>
    <packaging>pom</packaging>
    <version>8.1-SNAPSHOT</version>

    <parent>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-parent</artifactId>
        <version>3.0.0</version>
    </parent>

    <modules>
        <module>flow-osgi</module>
    </modules>

    <organization>
        <name>Vaadin Ltd</name>
        <url>https://vaadin.com</url>
    </organization>
    <url>https://vaadin.com</url>
    <licenses>
        <license>
            <name>Vaadin Commercial License and Service Terms</name>
            <url>https://vaadin.com/commercial-license-and-service-terms</url>
        </license>
    </licenses>
    <inceptionYear>2020</inceptionYear>
    <scm>
        <connection>scm:https:https://github.com/vaadin/osgi.git</connection>
        <developerConnection>scm:git:git@github.com:vaadin/osgi.git
        </developerConnection>
        <url>https://github.com/vaadin/osgi</url>
    </scm>

    <properties>
        <flow.release.repo.id>vaadin-prereleases</flow.release.repo.id>
        <flow.release.repo.url>
            https://maven.vaadin.com/vaadin-prereleases/
        </flow.release.repo.url>

        <flow.addons.repo.id>vaadin-addons</flow.addons.repo.id>
        <flow.addons.repo.url>
            https://maven.vaadin.com/vaadin-addons
        </flow.addons.repo.url>

        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8
        </project.reporting.outputEncoding>
        <jsinterop.version>1.0.1</jsinterop.version>
        <sonar.java.source>8</sonar.java.source>
        <sonar.analysis.mode>preview</sonar.analysis.mode>
        <sonar.issuesReport.console.enable>true
        </sonar.issuesReport.console.enable>
        <sonar.issuesReport.html.enable>true</sonar.issuesReport.html.enable>
        <failOnMissingWebXml>false</failOnMissingWebXml>

        <!-- Dependencies -->
        <slf4j.version>1.7.36</slf4j.version>

        <!-- Plugins -->
        <maven.surefire.plugin.version>2.22.0</maven.surefire.plugin.version>
        <maven.failsafe.plugin.version>2.22.0</maven.failsafe.plugin.version>
        <maven.resources.plugin.version>3.0.2</maven.resources.plugin.version>
        <maven.clean.plugin.version>3.0.0</maven.clean.plugin.version>
        <maven.exec.plugin.version>1.6.0</maven.exec.plugin.version>
        <testbench.version>8.2.2</testbench.version>
        <properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
        <karaf-maven-plugin.version>4.4.0</karaf-maven-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>

        <!-- OSGi -->
        <!-- Note: the parserVersion value is set by build-helper-maven-plugin -->
        <osgi.bundle.version>
            ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}
        </osgi.bundle.version>
        <bnd.version>6.1.0</bnd.version>
        <osgi.core.version>7.0.0</osgi.core.version>
        <osgi.compendium.version>7.0.0</osgi.compendium.version>
        <flow.version>23.6-SNAPSHOT</flow.version>

        <maven.test.skip>false</maven.test.skip>

        <!-- This property is needed to allow some Win-specific unit tests -->
        <!-- to be disabled via system property in CI until they got fixed -->
        <exclude.windows.failed.tests></exclude.windows.failed.tests>
    </properties>

    <repositories>
        <!-- The order of definitions matters. Explicitly defining central
            here to make sure it has the highest priority. -->
        <repository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>${flow.release.repo.id}</id>
            <url>${flow.release.repo.url}</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>${flow.addons.repo.id}</id>
            <url>${flow.addons.repo.url}</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <!-- The order of definitions matters. Explicitly defining central
            here to make sure it has the highest priority. -->
        <pluginRepository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>${flow.release.repo.id}</id>
            <url>${flow.release.repo.url}</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.1.0</version>
            </dependency>

            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>license-checker</artifactId>
                <version>1.13.4</version>
            </dependency>

            <!-- Test dependencies -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <extensions>
            <!-- Enabling the use of SSH for deployment -->
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh-external</artifactId>
                <version>3.5.2</version>
            </extension>
        </extensions>


        <plugins>
            <plugin>
                <groupId>org.commonjava.maven.plugins</groupId>
                <artifactId>directory-maven-plugin</artifactId>
                <version>0.1</version>
                <executions>
                    <execution>
                        <id>set-root-dir-for-common-lifecycle</id>
                        <goals>
                            <goal>highest-basedir</goal>
                        </goals>
                        <phase>initialize</phase>
                        <configuration>
                            <property>project.rootdir</property>
                        </configuration>
                    </execution>
                    <execution>
                        <id>set-root-dir-for-clean-lifecycle</id>
                        <goals>
                            <goal>highest-basedir</goal>
                        </goals>
                        <phase>pre-clean</phase>
                        <configuration>
                            <property>project.rootdir</property>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>parse-version</id>
                        <goals>
                            <goal>parse-version</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>biz.aQute.bnd</groupId>
                <artifactId>bnd-maven-plugin</artifactId>
                <version>${bnd.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>bnd-process</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.4.1</version>
                    <dependencies>
                        <dependency>
                            <groupId>de.skuzzle.enforcer</groupId>
                            <artifactId>restrict-imports-enforcer-rule
                            </artifactId>
                            <version>0.8.0</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>check-logging-imports</id>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <restrictImports
                                        implementation="de.skuzzle.enforcer.restrictimports.RestrictImports">
                                        <reason>Use SLF4j for logging</reason>
                                        <bannedImport>java.util.logging.**
                                        </bannedImport>
                                    </restrictImports>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                    <configuration>
                        <trimStackTrace>false</trimStackTrace>
                        <reuseForks>false</reuseForks>
                        <excludes>
                            <exclude>${exclude.windows.failed.tests}</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven.failsafe.plugin.version}</version>
                    <configuration>
                        <trimStackTrace>false</trimStackTrace>
                        <enableAssertions>true</enableAssertions>
                        <parallel>all</parallel>
                        <threadCount>2</threadCount>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.karaf.tooling</groupId>
                    <artifactId>karaf-maven-plugin</artifactId>
                    <version>${karaf-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </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.commonjava.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            directory-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [0.1,)
                                        </versionRange>
                                        <goals>
                                            <goal>highest-basedir</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-plugin-plugin
                                        </artifactId>
                                        <versionRange>
                                            [3.2,)
                                        </versionRange>
                                        <goals>
                                            <goal>descriptor</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>
                                            properties-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.0.0,)
                                        </versionRange>
                                        <goals>
                                            <goal>
                                                set-system-properties
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.6</version>
                    <configuration>
                        <header>src/license/vclst/header.txt</header>
                        <quiet>false</quiet>
                        <failIfMissing>true</failIfMissing>
                        <aggregate>false</aggregate>
                        <useDefaultExcludes>true</useDefaultExcludes>
                        <useDefaultMapping>true</useDefaultMapping>
                        <encoding>UTF-8</encoding>
                        <properties>
                            <year>${project.inceptionYear}</year>
                        </properties>
                        <excludes>
                            <exclude>target/**</exclude>
                            <exclude>**/*.xml</exclude>
                            <exclude>**/*.properties</exclude>
                            <exclude>src/license/**/*</exclude>
                            <exclude>**/*.txt</exclude>
                        </excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <profile>
            <id>validation</id>
            <activation>
                <property>
                    <name>!release</name>
                </property>
            </activation>
            <modules>
                <module>test-containers</module>
            </modules>
        </profile>
        <profile>
            <id>java11</id>
            <activation>
                <jdk>11</jdk>
            </activation>
            <properties>
                <maven.compiler.release>11</maven.compiler.release>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <artifactId>maven-surefire-plugin</artifactId>
                        </plugin>
                        <plugin>
                            <artifactId>maven-failsafe-plugin</artifactId>
                            <dependencies>
                                <dependency>
                                    <groupId>javax.xml.bind</groupId>
                                    <artifactId>jaxb-api</artifactId>
                                    <version>2.2.11</version>
                                </dependency>
                                <dependency>
                                    <groupId>com.sun.xml.bind</groupId>
                                    <artifactId>jaxb-core</artifactId>
                                    <version>2.2.11</version>
                                </dependency>
                                <dependency>
                                    <groupId>com.sun.xml.bind</groupId>
                                    <artifactId>jaxb-impl</artifactId>
                                    <version>2.2.11</version>
                                </dependency>
                                <dependency>
                                    <groupId>com.sun.activation</groupId>
                                    <artifactId>javax.activation</artifactId>
                                    <version>1.2.0</version>
                                </dependency>
                            </dependencies>
                        </plugin>
                    </plugins>
                </pluginManagement>

            </build>
        </profile>
    </profiles>
</project>

