<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>
    <parent>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-parent</artifactId>
        <version>3.0.0</version>
        <relativePath />
    </parent>
    <artifactId>vaadin-platform-parent</artifactId>
    <packaging>pom</packaging>
    <version>23.7-SNAPSHOT</version>
    <name>Vaadin Platform</name>
    <description>Vaadin Platform</description>
    <url>https://vaadin.com</url>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <hilla.version>1.4.0</hilla.version>
        <spring.boot.version>2.7.18</spring.boot.version>
        <!-- sb 2.x has end of free support, new spring framework 5.3 has security fixes -->
        <spring-framework.version>5.3.32</spring-framework.version>
    </properties>

    <distributionManagement>
        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>sbom</id>
            <modules>
                <module>vaadin-platform-sbom</module>
            </modules>
        </profile>
        <profile>
            <id>gradle</id>
            <modules>
                <module>vaadin-gradle-plugin</module>
                <module>vaadin-gradle-plugin/pom-portal.xml</module>
            </modules>
        </profile>
        <profile>
            <id>jandex</id>
            <modules>
                <module>vaadin-jandex</module>
                <module>vaadin-core-jandex</module>
                <module>vaadin-quarkus-extension</module>
            </modules>
        </profile>
        <!-- separate hilla related moduels for releases -->
        <profile>
            <id>hilla</id>
            <modules>
                <module>hilla-bom</module>
                <module>hilla</module>
                <module>hilla-react</module>
                <module>hilla-spring-boot-starter</module>
                <module>hilla-maven-plugin</module>
            </modules>
            <!-- This prevents deploying all com.vaadin modules, but we need to set it to true in
            all hilla modules  -->
            <properties>
                <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
                <maven.deploy.skip>true</maven.deploy.skip>
            </properties>
        </profile>
        <!-- separate platform modules for active by default it must be after hilla modules -->
        <profile>
            <id>platform</id>
            <activation>
                <property>
                    <name>!skipPlatform</name>
                </property>
            </activation>
            <modules>
                <module>vaadin</module>
                <module>vaadin-spring-bom</module>
                <module>vaadin-bom</module>
                <module>vaadin-core</module>
                <module>vaadin-maven-plugin</module>
                <module>vaadin-testbench</module>
                <module>vaadin-spring-boot-starter</module>
                <module>vaadin-platform-javadoc</module>
            </modules>
            <properties>
                <skipNexusStagingDeployMojo>false</skipNexusStagingDeployMojo>
                <maven.deploy.skip>false</maven.deploy.skip>
            </properties>
        </profile>
        <!-- Needed so as we can skip this module on releasing and still nexus stating works -->
        <profile>
            <id>npm-it</id>
            <modules>
                <module>vaadin-platform-test</module>
            </modules>
        </profile>
        <profile>
            <id>npm-it-servlet-containers</id>
            <modules>
                <module>vaadin-platform-servlet-containers-tests</module>
            </modules>
        </profile>
        <profile>
            <id>fusion-hybrid</id>
            <modules>
                <module>vaadin-platform-hybrid-test</module>
            </modules>
        </profile>
    </profiles>
    <scm>
        <url>https://github.com/vaadin/platform</url>
        <connection>scm:git:https://github.com/vaadin/platform.git</connection>
        <developerConnection>scm:git:git@github.com:vaadin/platform.git</developerConnection>
    </scm>

    <repositories>
        <!-- The order of definitions matters. Explicitly defining central here to make sure it has the highest priority. -->

        <!-- Main Maven repository -->
        <repository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <!-- Main Maven repository -->
        <pluginRepository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                     <artifactId>maven-war-plugin</artifactId>
                     <version>3.3.1</version>
                </plugin>
                <plugin>
                     <groupId>com.vaadin</groupId>
                     <artifactId>vaadin-maven-plugin</artifactId>
                     <version>${project.version}</version>
                </plugin>
                <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>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.3.1</version>
                    <configuration>
                        <includeDependencySources>true</includeDependencySources>
                        <includeTransitiveDependencySources>true</includeTransitiveDependencySources>
                        <dependencySourceExcludes>
                            <!-- Exclude client engine since it is not user
                                facing API -->
                            <dependencySourceExclude>com.vaadin:flow-client</dependencySourceExclude>
                            <dependencySourceExclude>com.vaadin:license-checker</dependencySourceExclude>
                        </dependencySourceExcludes>
                        <dependencySourceIncludes>
                            <dependencySourceInclude>com.vaadin:*</dependencySourceInclude>
                        </dependencySourceIncludes>
                        <!-- Don't fail on doclint errors for missing servlet
                            artifact -->
                        <doclint>none</doclint>
                        <quiet>true</quiet>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.karaf.tooling</groupId>
                    <artifactId>karaf-maven-plugin</artifactId>
                    <version>4.3.0</version>
                    <extensions>true</extensions>
                    <executions>
                            <execution>
                            <id>generate-features-file</id>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>features-generate-descriptor</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
