logo YUI Compressor Maven Mojo

To compress (Minify + Ofuscate) Javascript files and CSS files (using YUI Compressor from Julien Lecomte) and/or to check Javascript files with jslint.

homepage:
fresh index:
last release: 1 decade ago, first release: 1 decade ago
packaging: maven-plugin
get this artifact from: central
see this artifact on: search.maven.org


Display vulnerabilities (snyk): Vulnerability check

This chart shows how much is this artifact used as a dependency in other Maven artifacts in Central repository and GitHub:


select version:

Add this snippet into pom.xml inside tag <project><build><plugins>:




Switch to artifact.
goals:
yuicompressor:jslint (phase: process-resources)

Check JS files with jslint.

yuicompressor:compress (phase: process-resources)

Apply compression on JS and CSS (using YUI Compressor).

Often used code snippets:

<plugin>
  <groupId>net.sf.alchim</groupId>
  <artifactId>yuicompressor-maven-plugin</artifactId>
  <version>0.7.1</version>
  <executions>
    <execution>
      <goals>
        <goal>compress</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <nosuffix>true</nosuffix>
  </configuration>
</plugin>
<plugin>
  <groupId>net.sf.alchim</groupId>
  <artifactId>yuicompressor-maven-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>compress</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <nosuffix>true</nosuffix>
  </configuration>
</plugin>
<plugin>
  <groupId>net.sf.alchim</groupId>
  <artifactId>yuicompressor-maven-plugin</artifactId>
  <executions>
    <execution>
      <phase>process-resources</phase>
      <goals>
        <goal>compress</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <nosuffix>true</nosuffix>
    <force>false</force>
    <excludes>
      <exclude>**/*.java</exclude>
      <exclude>**/interface-*.js</exclude>
      <exclude>**/*pack.js</exclude>
      <exclude>**/compressed.css</exclude>
      <exclude>**/crop.css</exclude>
      <exclude>**/*.html</exclude>
    </excludes>
  </configuration>
</plugin>
<plugin>
  <groupId>net.sf.alchim</groupId>
  <artifactId>yuicompressor-maven-plugin</artifactId>
  <executions>
    <execution>
      <phase>process-resources</phase>
      <goals>
        <goal>compress</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <nosuffix>true</nosuffix>
    <force>false</force>
    <excludes>
      <exclude>**/interface-*.js</exclude>
      <exclude>**/*pack.js</exclude>
      <exclude>**/compressed.css</exclude>
      <exclude>**/crop.css</exclude>
      <exclude>**/*.java</exclude>
      <exclude>**/*.html</exclude>
      <exclude>**/*.xml</exclude>
      <exclude>**/*.properties</exclude>
    </excludes>
  </configuration>
</plugin>
<plugin>
  <groupId>net.sf.alchim</groupId>
  <artifactId>yuicompressor-maven-plugin</artifactId>
  <version>0.7.1</version>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>2.0.1</version>
    </dependency>
  </dependencies>
  <executions>
    <execution>
      <goals>
        <goal>compress</goal>
      </goals>
      <configuration>
        <aggregations>
          <aggregation>
            <output>${project.build.directory}/classes/static/js/nexus-lvo-plugin-all.js</output>
            <includes>
              <include>${project.build.directory}/classes/static/js/repoServer.NexusUpgradeChecker.js</include>
            </includes>
          </aggregation>
        </aggregations>
      </configuration>
    </execution>
  </executions>
  <configuration>
    <nosuffix>true</nosuffix>
    <nomunge>true</nomunge>
    <jswarn>false</jswarn>
    <aggregations>
      <aggregation>
        <insertNewLine>true</insertNewLine>
      </aggregation>
    </aggregations>
  </configuration>
</plugin>

© Jiri Pinkas 2015 - 2022. All rights reserved! Admin login To submit bugs / feature requests please use this github page
related: JavaVids | Top Java Blogs | Java školení
Apache and Apache Maven are trademarks of the Apache Software Foundation. The Central Repository is a service mark of Sonatype, Inc.