Skip to content

UnknownNPC/json-compressor-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codecov Maven Central

json-compressor-maven-plugin

Overview

Plugin removes useless whitespaces and newlines in target json files. It helps to reduce file sizes before they get packaged.

Content

Install

Requires Java 1.11 and Maven 3.x+

mvn clean install

Usage in pom.xml

<plugin>
	<groupId>com.github.unknownnpc.plugins</groupId>
	<artifactId>json-compressor</artifactId>
	<version>1.3</version>
	<executions>
		<execution>
			<goals>
				<goal>minify</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<includes>
			<include>${project.build.directory}/classes/large-file.json</include>
			<include>${project.build.directory}/classes/large-files-*.json</include>
		</includes>
		<excludes>
			<exclude>${project.build.directory}/classes/large-files-3.json</exclude>
		</excludes>
	</configuration>
</plugin>

Plugin is also support skip configuration parameter, eg. <configuration><skip>true</skip></configuration>.

Run

mvn com.github.unknownnpc.plugins:json-compressor:minify

Example

Before
{
    "id": 1,
    "name": "A green door",
    "price": 12.50,
    "tags": ["home", "green"]
}
After
{"id":1,"name":"A green door","price":12.5,"tags":["home","green"]}

About

Plugin removes useless whitespaces and newlines in target json files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages