<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.rascalmpl</groupId>
  <artifactId>rascal-lsp</artifactId>
  <version>2.22.5</version>
  <licenses>
    <license>
      <name>BSD-2-Clause</name>
      <url>https://opensource.org/licenses/BSD-2-Clause</url>
      <distribution>manual</distribution>
    </license>
  </licenses>
  <scm>
    <developerConnection>scm:git:ssh://git@github.com/usethesource/rascal-language-servers.git</developerConnection>
  </scm>
  <build>
    <resources>
      <resource>
        <directory>.</directory>
        <includes>
          <include>META-INF/RASCAL.MF</include>
        </includes>
      </resource>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>src/main/rascal</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.15.0</version>
        <configuration>
          <release>11</release>
          <showWarnings>true</showWarnings>
          <compilerArgs>
            <parameters />
            <Werror />
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-junit47</artifactId>
            <version>3.5.5</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.rascalmpl</groupId>
        <artifactId>rascal-maven-plugin</artifactId>
        <version>0.31.0</version>
        <executions>
          <execution>
            <id>default-compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>default-package</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>package</goal>
            </goals>
          </execution>
          <execution>
            <id>default-tutor</id>
            <phase>process-resources</phase>
            <goals>
              <goal>tutor</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <errorsAsWarnings>false</errorsAsWarnings>
          <bin>${project.build.outputDirectory}</bin>
          <srcs>
            <src>${project.basedir}/src/main/rascal/library</src>
          </srcs>
          <sources>|http://github.com/usethesource/rascal-language-servers/blob/main/rascal-lsp|</sources>
          <issues>|http://github.com/usethesource/rascal-language-servers/issues|</issues>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.10.0</version>
        <executions>
          <execution>
            <id>copy</id>
            <phase>validate</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
              <overWriteSnapshots>true</overWriteSnapshots>
              <artifactItems>
                <artifactItem>
                  <groupId>org.rascalmpl</groupId>
                  <artifactId>rascal</artifactId>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/lib</outputDirectory>
                  <destFileName>rascal.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.6.2</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>
                <transformer />
                <transformer />
                <transformer>
                  <manifestEntries>
                    <Name>rascal-lsp</Name>
                    <Multi-Release>true</Multi-Release>
                    <Main-Class>org.rascalmpl.vscode.lsp.RascalLanguageServer</Main-Class>
                    <Specification-Version>${project.version}</Specification-Version>
                    <Specification-Vendor>http://www.usethesource.io</Specification-Vendor>
                  </manifestEntries>
                </transformer>
              </transformers>
              <artifactSet>
                <excludes>
                  <exclude>org.rascalmpl:rascal</exclude>
                  <exclude>org.rascalmpl:typepal</exclude>
                  <exclude>io.usethesource:vallang</exclude>
                  <exclude>io.usethesource:capsule</exclude>
                  <exclude>org.apache.commons:commons-compress</exclude>
                  <exclude>org.tukaani:xz</exclude>
                  <exclude>com.github.luben:zstd-jni</exclude>
                  <exclude>com.github.ben-manes.caffeine:caffeine</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-transform-maven-shade-plugin-extensions</artifactId>
            <version>0.2.0</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>5.0.0</version>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <headerDefinitions>
            <headerDefinition>rascal_style.xml</headerDefinition>
          </headerDefinitions>
          <licenseSets>
            <licenseSet>
              <header>../LICENSE.txt</header>
              <excludes>
                <exclude>rascal_style.xml</exclude>
                <exclude>checkstyle.xml</exclude>
                <exclude>**/README</exclude>
                <exclude>src/test/resources/**</exclude>
                <exclude>src/main/resources/**</exclude>
                <exclude>**/*.tpl</exclude>
                <exclude>META-INF/**</exclude>
                <exclude>.editorconfig</exclude>
                <exclude>CITATION</exclude>
                <exclude>FUNDING</exclude>
              </excludes>
            </licenseSet>
          </licenseSets>
          <mapping>
            <java>SLASHSTAR_STYLE</java>
            <rsc>RASCAL_STYLE</rsc>
          </mapping>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.6.2</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>3.8.2</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.6.0</version>
        <configuration>
          <configLocation>checkstyle.xml</configLocation>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.14</version>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>report</id>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <formats>
                    <format>XML</format>
                  </formats>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>checker-framework</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.rascalmpl</groupId>
            <artifactId>rascal-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>default-compile</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>default-tutor</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <fork>true</fork>
              <compilerArgs>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
                <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
                <arg>-Astubs=src/main/checkerframework</arg>
                <arg>-AstubWarnIfNotFound</arg>
                <arg>-AsuppressWarnings=initialization</arg>
                <arg>-Xmaxerrs</arg>
                <arg>1000</arg>
              </compilerArgs>
              <annotationProcessorPaths>
                <path>
                  <groupId>org.checkerframework</groupId>
                  <artifactId>checker</artifactId>
                  <version>${checkerframework.version}</version>
                </path>
              </annotationProcessorPaths>
              <annotationProcessors>
                <annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor>
              </annotationProcessors>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>org.checkerframework</groupId>
          <artifactId>checker</artifactId>
          <version>${checkerframework.version}</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>org.checkerframework</groupId>
          <artifactId>checker-qual</artifactId>
          <version>${checkerframework.version}</version>
        </dependency>
      </dependencies>
      <properties>
        <checkerframework.version>3.42.0</checkerframework.version>
      </properties>
    </profile>
  </profiles>
  <repositories>
    <repository>
      <id>usethesource-releases</id>
      <url>https://releases.usethesource.io/maven/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>usethesource-releases</id>
      <url>https://releases.usethesource.io/maven/</url>
    </pluginRepository>
  </pluginRepositories>
  <dependencies>
    <dependency>
      <groupId>org.rascalmpl</groupId>
      <artifactId>rascal</artifactId>
      <version>0.42.2</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>5.23.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>byte-buddy-agent</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>objenesis</artifactId>
          <groupId>org.objenesis</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <log4j2.version>2.25.4</log4j2.version>
    <lsp4j.version>0.24.0</lsp4j.version>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    <mockito.version>5.23.0</mockito.version>
    <sonar.organization>usethesource</sonar.organization>
    <maven-surefire-plugin.version>3.5.5</maven-surefire-plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <junit.version>4.13.2</junit.version>
  </properties>
</project>
