Skip to content

Maven HTMLCompressor Plugin allows to compress HTML/XML files by adding a few lines to the pom file.

License

Notifications You must be signed in to change notification settings

rimus93/htmlcompressor-maven-plugin

 
 

Repository files navigation

Maven HTMLCompressor Plugin

BuildStatus Mavencentral Apache2

Overview

Maven HTMLCompressor Plugin allows to compress HTML/XML files by adding a few lines to the pom file. This plugin uses htmlcompressor library.

Getting started

The simplest way to start using this plugin is:

1.Enable plugin in your pom.xml

<build>
    <plugins>
        <plugin>
            <groupId>com.github.hazendaz.maven</groupId>
            <artifactId>htmlcompressor-maven-plugin</artifactId>
            <version>1.4.0</version>
            <configuration>
                <goalPrefix>htmlcompressor</goalPrefix>
            </configuration>
        </plugin>
    </plugins>
</build>

2.Put XML and HTML files under src/main/resources into any underlying structure as HTMLCompressor will recursively process files

3.For HTML compression, create integration.js file under src/main/resources where html is stored with the contents like below. It will integrate HTML templates into JavaScript (%s will be replaced with JSON object and copied to the target folder).

var htmlTemplatesInjector = {
    htmlTemplates: %s
};

4.Run maven goals:

mvn htmlcompressor:html
mvn htmlcompressor:xml

5.Check the target folder for output where resources are stored.

Here is demo you can download

More information about HTML/XML compression plugin configuration at wiki page:

License

Apache License version 2.0

Issues tracking

Issues tracking is available on GitHub issues

Bug reports, feature requests, and general inquiries welcome.

About

Maven HTMLCompressor Plugin allows to compress HTML/XML files by adding a few lines to the pom file.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 95.9%
  • HTML 4.0%
  • JavaScript 0.1%