<?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">
  <parent>
    <artifactId>java-fv-parent</artifactId>
    <groupId>io.github.o2alexanderfedin.javafv</groupId>
    <version>1.2.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>compiler-plugin</artifactId>
  <name>Java-FV Compiler Plugin</name>
  <description>javac plugin for ACSL constraint inference</description>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>test-compile-with-jmh</id>
            <phase>test-compile</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
            <configuration>
              <annotationProcessorPaths>
                <path>
                  <groupId>org.openjdk.jmh</groupId>
                  <artifactId>jmh-generator-annprocess</artifactId>
                  <version>1.37</version>
                </path>
              </annotationProcessorPaths>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <annotationProcessorPaths>
            <path>
              <groupId>org.immutables</groupId>
              <artifactId>value</artifactId>
              <version>${immutables.version}</version>
            </path>
            <path>
              <groupId>com.google.auto.service</groupId>
              <artifactId>auto-service</artifactId>
              <version>${auto-service.version}</version>
            </path>
            <path>
              <groupId>org.openjdk.jmh</groupId>
              <artifactId>jmh-generator-annprocess</artifactId>
              <version>1.37</version>
            </path>
          </annotationProcessorPaths>
          <testExcludes>
            <testExclude>**/SmtLibBuilderTest.java</testExclude>
            <testExclude>**/benchmark/InterproceduralAnalyzerBenchmark.java</testExclude>
            <testExclude>**/benchmark/PatternMatcherBenchmark.java</testExclude>
            <testExclude>**/PostconditionAnalyzerTest.java</testExclude>
            <testExclude>**/RecordAndSealedIntegrationTest.java</testExclude>
            <testExclude>**/RecordInvariantExtractorTest.java</testExclude>
            <testExclude>**/ReflectionBypassDetectorTest.java</testExclude>
            <testExclude>**/PatternContractGeneratorTest.java</testExclude>
            <testExclude>**/ExhaustivenessEncoderTest.java</testExclude>
            <testExclude>**/AtomicSemanticAnalyzerTest.java</testExclude>
            <testExclude>**/LockOrderAnalyzerTest.java</testExclude>
            <testExclude>**/LockOrderEncoderTest.java</testExclude>
            <testExclude>**/AtomicEncoderTest.java</testExclude>
            <testExclude>**/ConcurrencyPipelineIntegrationTest.java</testExclude>
            <testExclude>**/ConcurrencySmtIntegrationTest.java</testExclude>
            <testExclude>**/ExceptionPathEncoderTest.java</testExclude>
            <testExclude>**/TreeCompatTest.java</testExclude>
          </testExcludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.12</version>
        <executions>
          <execution>
            <id>jacoco-prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>jacoco-report</id>
            <phase>verify</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>jacoco-check</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <rules>
                <rule>
                  <element>BUNDLE</element>
                  <limits>
                    <limit>
                      <counter>INSTRUCTION</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.80</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>@{argLine}</argLine>
          <excludes>
            <exclude>**/benchmark/**</exclude>
            <exclude>**/jmh_generated/**</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.5.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <finalName>benchmarks</finalName>
              <shadedArtifactAttached>false</shadedArtifactAttached>
              <shadeTestJar>true</shadeTestJar>
              <transformers>
                <transformer>
                  <mainClass>org.openjdk.jmh.Main</mainClass>
                </transformer>
                <transformer />
              </transformers>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <artifactSet>
                <includes>
                  <include>*:*</include>
                </includes>
              </artifactSet>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.6.0</version>
        <configuration>
          <configLocation>checkstyle.xml</configLocation>
          <consoleOutput>true</consoleOutput>
          <failsOnError>false</failsOnError>
          <violationSeverity>warning</violationSeverity>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>3.28.0</version>
        <configuration>
          <failOnViolation>false</failOnViolation>
          <printFailingErrors>true</printFailingErrors>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>benchmark</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>3.1.1</version>
            <executions>
              <execution>
                <id>run-benchmarks</id>
                <phase>verify</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>java</executable>
                  <arguments>
                    <argument>-jar</argument>
                    <argument>${project.build.directory}/benchmarks.jar</argument>
                    <argument>-rf</argument>
                    <argument>json</argument>
                    <argument>-rff</argument>
                    <argument>${project.build.directory}/benchmark-results.json</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.immutables</groupId>
      <artifactId>value</artifactId>
      <version>2.10.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.auto.service</groupId>
      <artifactId>auto-service</artifactId>
      <version>1.1.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>5.10.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>opentest4j</artifactId>
          <groupId>org.opentest4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-platform-commons</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.10.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-platform-engine</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>5.10.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.24.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>5.15.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy-agent</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>objenesis</artifactId>
          <groupId>org.objenesis</groupId>
        </exclusion>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <version>5.15.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit</artifactId>
      <version>6.8.0.202311291450-r</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>JavaEWAH</artifactId>
          <groupId>com.googlecode.javaewah</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-codec</artifactId>
          <groupId>commons-codec</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-core</artifactId>
      <version>1.37</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>jopt-simple</artifactId>
          <groupId>net.sf.jopt-simple</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-math3</artifactId>
          <groupId>org.apache.commons</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-generator-annprocess</artifactId>
      <version>1.37</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
