<?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>

  <parent>
    <groupId>org.sonarsource.parent</groupId>
    <artifactId>parent</artifactId>
    <version>68.0.0.247</version>
  </parent>

  <groupId>org.sonarsource.plugins.cayc</groupId>
  <artifactId>sonar-cayc-plugin</artifactId>
  <packaging>sonar-plugin</packaging>
  <version>2.0.0.334</version>
  <scm>
    <url>https://github.com/SonarSource/sonar-cayc-stats-plugin</url>
  </scm>
  <issueManagement>
    <url>https://sonarsource.atlassian.net/jira/software/c/projects/CAYCPLUGIN</url>
  </issueManagement>

  <name>Clean as You Code Plugin</name>
  <description>Demonstrates the value of Clean as You Code methodology</description>

  <inceptionYear>2022</inceptionYear>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <sonar.apiVersion>9.8.0.203</sonar.apiVersion>
    <sonar.testingHarnessVersion>9.5.0.56709</sonar.testingHarnessVersion>
    <jdk.min.version>11</jdk.min.version>
    <sonar.sources>src/main/java,src/main/ts</sonar.sources>
    <sonar.javascript.lcov.reportPaths>./coverage/lcov.info</sonar.javascript.lcov.reportPaths>
    <sonar.coverage.exclusions>src/main/java/org/sonar/plugin/cayc/CleanAsYouCodePlugin.java</sonar.coverage.exclusions>
    <gitRepositoryName>sonar-cayc-stats-plugin</gitRepositoryName>
    <artifactsToPublish>${project.groupId}:sonar-cayc-plugin:jar</artifactsToPublish>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.sonarsource.api.plugin</groupId>
      <artifactId>sonar-plugin-api</artifactId>
      <version>${sonar.apiVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <!-- packaged with the plugin -->
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
    </dependency>
    <dependency>
      <groupId>org.sonarsource.sonarqube</groupId>
      <artifactId>sonar-ws</artifactId>
      <version>9.7.1.62043</version>
    </dependency>


    <!-- unit tests -->
    <dependency>
      <groupId>org.sonarsource.sonarqube</groupId>
      <artifactId>sonar-testing-harness</artifactId>
      <version>${sonar.testingHarnessVersion}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>5.1.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.24.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.11.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.googlecode.json-simple</groupId>
      <artifactId>json-simple</artifactId>
      <version>1.1</version>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>
        <artifactId>sonar-packaging-maven-plugin</artifactId>
        <version>1.21.0.505</version>
        <extensions>true</extensions>
        <configuration>
          <pluginKey>cayc</pluginKey>
          <pluginName>Clean as You Code</pluginName>
          <pluginDescription>Demonstrates the value of Clean as You Code methodology</pluginDescription>
          <pluginClass>org.sonar.plugin.cayc.CleanAsYouCodePlugin</pluginClass>
          <sonarQubeMinVersion>8.9</sonarQubeMinVersion>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
        <configuration>
          <release>11</release>
        </configuration>
      </plugin>
      <plugin>
        <!-- UTF-8 bundles are not supported by Java, so they must be converted during build -->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>native2ascii-maven-plugin</artifactId>
        <version>2.0.1</version>
        <executions>
          <execution>
            <goals>
              <goal>resources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>1.9.1</version>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <id>install node and yarn</id>
            <goals>
              <goal>install-node-and-yarn</goal>
            </goals>
            <configuration>
              <nodeVersion>v16.14.0</nodeVersion>
              <yarnVersion>v1.22.5</yarnVersion>
            </configuration>
          </execution>
          <execution>
            <id>yarn install</id>
            <goals>
              <goal>yarn</goal>
            </goals>
          </execution>
          <execution>
            <phase>generate-resources</phase>
            <id>yarn run script</id>
            <goals>
              <goal>yarn</goal>
            </goals>
            <configuration>
              <arguments>build</arguments>
            </configuration>
          </execution>
          <execution>
            <phase>test</phase>
            <id>yarn run tests</id>
            <goals>
              <goal>yarn</goal>
            </goals>
            <configuration>
              <arguments>test --coverage</arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
