<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>org.eclipse.dirigible</groupId>
        <artifactId>dirigible-components-parent</artifactId>
        <version>13.4.0</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <name>Components - IDE - Java LSP</name>
    <artifactId>dirigible-components-ide-java-lsp</artifactId>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.dirigible</groupId>
            <artifactId>dirigible-components-core-base</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.dirigible</groupId>
            <artifactId>dirigible-components-engine-java</artifactId>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>${project.build.directory}/jdtls-download</directory>
                <targetPath>jdtls</targetPath>
            </resource>
            <resource>
                <directory>${project.build.directory}/jdtls-debug-plugin</directory>
                <targetPath>jdtls-debug</targetPath>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>com.googlecode.maven-download-plugin</groupId>
                <artifactId>download-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>download-jdtls</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <skip>${jdtls.download.skip}</skip>
                            <url>${jdtls.download.url}</url>
                            <outputDirectory>${project.build.directory}/jdtls-download</outputDirectory>
                            <outputFileName>jdtls.tar.gz</outputFileName>
                            <sha256>${jdtls.sha256}</sha256>
                            <cacheDirectory>${settings.localRepository}/jdtls-cache</cacheDirectory>
                            <readTimeOut>300000</readTimeOut>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-java-debug-plugin</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <skip>${java.debug.plugin.download.skip}</skip>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.microsoft.java</groupId>
                                    <artifactId>com.microsoft.java.debug.plugin</artifactId>
                                    <version>${java.debug.plugin.version}</version>
                                    <destFileName>com.microsoft.java.debug.plugin.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.build.directory}/jdtls-debug-plugin</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <properties>
        <license.header.location>../../../licensing-header.txt</license.header.location>
        <parent.pom.folder>../../../</parent.pom.folder>
    </properties>

</project>
