<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 https://maven.apache.org/xsd/maven-4.0.0.xsd://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent>

  <groupId>org.silverpeas.maven</groupId>
  <artifactId>silverpeas-ui-compressor-maven-plugin</artifactId>
  <version>2.0.1</version>
  <packaging>maven-plugin</packaging>

  <name>Silverpeas's UI Compressor Maven Plugin</name>
  <url>https://github.com/Silverpeas/silverpeas-ui-compressor-maven-plugin</url>
  <inceptionYear>2019</inceptionYear>
  <description>
    A Maven plugin to minify the JavaScript and the CSS resources of Silverpeas. The JavaScript is
    minified with the Google Closure Compiler and the CSS with ph-css, both supporting the latest
    ECMAScript and CSS syntaxes.
  </description>

  <scm>
    <connection>scm:git:git@github.com:Silverpeas/silverpeas-ui-compressor-maven-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:Silverpeas/silverpeas-ui-compressor-maven-plugin.git</developerConnection>
    <url>https://github.com/Silverpeas/silverpeas-ui-compressor-maven-plugin</url>
    <tag>HEAD</tag>
  </scm>

  <repositories>
    <repository>
      <id>Silverpeas</id>
      <layout>default</layout>
      <name>Silverpeas Repository</name>
      <url>https://nexus3.silverpeas.org/repository/silverpeas</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <distributionManagement>
    <repository>
      <id>silverpeas</id>
      <name>Repository Silverpeas</name>
      <layout>default</layout>
      <url>https://nexus3.silverpeas.org/repository/releases/</url>
    </repository>
    <snapshotRepository>
      <id>silverpeas-snapshots</id>
      <name>Snapshots Repository Silverpeas</name>
      <layout>default</layout>
      <url>https://nexus3.silverpeas.org/repository/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <next.release>2.0.1</next.release>
    <!-- Keep a Closure Compiler release still compiled for Java 11 (bytecode 55): the minifier runs
         on the build JVM, so a version targeting Java 21 (v20250402+) would fail on our Java 17
         toolchain with an UnsupportedClassVersionError. -->
    <closure.compiler.version>v20240317</closure.compiler.version>
    <!-- ph-css 8.2.x supports the CSS Nesting Module Level 1 and the other modern CSS syntaxes;
         8.2.1 is compiled for Java 17 (bytecode 61), safe on our Java 17 toolchain. -->
    <phcss.version>8.2.1</phcss.version>
    <junit.version>6.1.1</junit.version>
    <maven.version>3.8.6</maven.version>
    <maven.compiler.release>17</maven.compiler.release>
    <encoding>UTF-8</encoding>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <prerequisites>
    <maven>${maven.version}</maven>
  </prerequisites>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- Google Closure Compiler: minifies the JavaScript with support of the modern ECMAScript
         (ES6+: template literals, const/let, arrow functions, ...). -->
    <dependency>
      <groupId>com.google.javascript</groupId>
      <artifactId>closure-compiler</artifactId>
      <version>${closure.compiler.version}</version>
    </dependency>
    <!-- ph-css: minifies the CSS with a real CSS parser supporting the latest syntaxes (CSS
         nesting, custom properties, calc()/var(), @layer, :has(), @supports, ...). -->
    <dependency>
      <groupId>com.helger</groupId>
      <artifactId>ph-css</artifactId>
      <version>${phcss.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven.version}</version>
      <scope>provided</scope>
    </dependency>
    <!-- provides the DirectoryScanner used to discover the resources to compress (maven-core is
         'provided', so its own plexus-utils isn't part of the plugin realm at runtime). -->
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>4.0.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <!-- aligns the JUnit Platform launcher used by Surefire with the JUnit 6 engine. -->
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-launcher</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.15.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>3.15.0</version>
        </plugin>
        <!-- Surefire 3.x runs the tests on the JUnit Platform (JUnit Jupiter / JUnit 6). -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.5.6</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
