<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.vaadin</groupId>
        <artifactId>flow-plugins</artifactId>
        <version>24.10.preserve-on-refresh-app-shell-title-SNAPSHOT</version>
    </parent>
    <artifactId>flow-maven-plugin</artifactId>
    <packaging>maven-plugin</packaging>
    <name>Flow Maven plugin</name>

    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>flow-plugin-base</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-invoker</artifactId>
            <version>3.3.0</version>
        </dependency>
        <!--
            maven-invoker depends on a maven-shared-utils version that currently
            conflicts with the one defined by maven-core, resulting in test failures
            for the GenerateMavenBOMMojo. maven-shared-utils is pinned with scope provided
            to make test succeed. At runtime, the correct version is picked when the
            flow generate-maven-sbom goal is executed.
        -->
        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-shared-utils</artifactId>
            <version>3.4.2</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.15.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-build-api</artifactId>
            <version>1.2.0</version>
        </dependency>

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>flow-polymer2lit</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    <!-- Needed for lambdas in Mojos -->
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>3.15.2</version>
                    <configuration>
                        <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                        <goalPrefix>flow</goalPrefix>
                        <requiredMavenVersion>3.5</requiredMavenVersion>
                        <requiredJavaVersion>${maven.compiler.release}</requiredJavaVersion>
                    </configuration>
                    <executions>
                        <execution>
                            <id>mojo-descriptor</id>
                            <goals>
                                <goal>descriptor</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-invoker-plugin</artifactId>
                <version>3.9.0</version>
                <configuration>
                    <skipInstallation>${skipTests}</skipInstallation>
                    <skipInvocation>${skipTests}</skipInvocation>
                    <localRepositoryPath>target/local-repo</localRepositoryPath>
                    <extraArtifacts>
                        <artifact>com.vaadin:flow-client:${project.version}</artifact>
                        <artifact>com.vaadin:flow-react:${project.version}</artifact>
                    </extraArtifacts>
                    <streamLogsOnFailures>true</streamLogsOnFailures>
                    <settingsFile>src/it/settings.xml</settingsFile>
                    <postBuildHookScript>verify</postBuildHookScript>
                    <addTestClassPath>true</addTestClassPath>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>install</goal>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

    </build>
</project>
