<?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.codelibs</groupId>
  <artifactId>yuicompressor</artifactId>
  <version>2.4.11</version>
  <packaging>jar</packaging>

  <name>YUI Compressor</name>
  <description>
    The YUI Compressor is a JavaScript compressor which, in addition to removing
    comments and white-spaces, obfuscates local variables using the smallest
    possible variable name. This obfuscation is safe, even when using constructs
    such as 'eval' or 'with' (although the compression is not optimal is those
    cases) Compared to jsmin, the average savings is around 20%.
  </description>
  <url>https://github.com/codelibs/yuicompressor</url>

  <licenses>
    <license>
      <name>BSD License</name>
      <url>https://raw.githubusercontent.com/codelibs/yuicompressor/refs/heads/main/LICENSE</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:codelibs/yuicompressor.git</connection>
    <url>scm:git:git@github.com:codelibs/yuicompressor.git</url>
    <developerConnection>scm:git:git@github.com:codelibs/yuicompressor.git</developerConnection>
    <tag>yuicompressor-2.4.11</tag>
  </scm>

  <organization>
    <name>CodeLibs Project</name>
    <url>https://www.codelibs.org/</url>
  </organization>

  <developers>
    <developer>
      <id>shinsuke</id>
      <name>Shinsuke Sugaya</name>
      <email>shinsuke.sugaya@codelibs.co</email>
      <organization>CodeLibs Inc.</organization>
      <organizationUrl>https://codelibs.co</organizationUrl>
    </developer>
  </developers>

  <contributors>
    <contributor>
      <name>Julien Lecomte</name>
    </contributor>
    <contributor>
      <name>Isaac Z. Schlueter</name>
    </contributor>
  </contributors>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <maven.compiler.release>11</maven.compiler.release>
  </properties>

  <dependencies>
    <!-- Command line argument parser -->
    <dependency>
      <groupId>args4j</groupId>
      <artifactId>args4j</artifactId>
      <version>2.37</version>
    </dependency>

    <!-- Mozilla Rhino JavaScript engine - upgraded to latest version -->
    <!-- Version 1.8.0 (2024) with modern AST API -->
    <dependency>
      <groupId>org.mozilla</groupId>
      <artifactId>rhino</artifactId>
      <version>1.8.0</version>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.13.4</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- Compiler plugin for Java 11+ -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.16.0</version>
        <configuration>
          <source>11</source>
          <target>11</target>
          <release>11</release>
          <encoding>UTF-8</encoding>
          <showDeprecation>false</showDeprecation>
          <debug>true</debug>
        </configuration>
      </plugin>

      <!-- Surefire plugin for running tests -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.5.6</version>
        <configuration>
          <includes>
            <include>**/*Test.java</include>
            <include>**/Test*.java</include>
          </includes>
        </configuration>
      </plugin>

      <!-- Shade plugin to create fat JAR with dependencies -->
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.6.2</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <mainClass>com.yahoo.platform.yui.compressor.Bootstrap</mainClass>
                </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>
              <createDependencyReducedPom>false</createDependencyReducedPom>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- JAR plugin configuration -->
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <archive>
            <manifest>
              <mainClass>com.yahoo.platform.yui.compressor.Bootstrap</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <!-- Javadoc plugin for Maven Central -->
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.12.0</version>
        <configuration>
          <source>11</source>
          <encoding>UTF-8</encoding>
          <docencoding>UTF-8</docencoding>
          <charset>UTF-8</charset>
          <doclint>none</doclint>
        </configuration>
      </plugin>

      <!-- Release plugin: <releaseProfiles> makes release:perform run its
           forked deploy build with -Prelease, which is what attaches the
           sources jar, the javadoc jar and the GPG signatures that Maven
           Central requires. -->
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>3.3.1</version>
        <configuration>
          <releaseProfiles>release</releaseProfiles>
        </configuration>
      </plugin>

      <!-- Central Publishing Plugin -->
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.11.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- Everything Maven Central requires on top of the plain jar: the sources
         jar, the javadoc jar and the GPG signatures. Signing needs a GPG key
         and a working pinentry, neither of which a build machine or a developer
         running `mvn install` necessarily has, so none of it is bound outside
         this profile. -->
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.4.0</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <!-- Configuration comes from the declaration in <build>; this only
               attaches the javadoc jar to the release. -->
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.7</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
