https://github.com/unknownnpc/json-compressor-maven-plugin
Plugin removes useless whitespaces and newlines in target json files
https://github.com/unknownnpc/json-compressor-maven-plugin
json maven-plugin newline whitespace
Last synced: 6 months ago
JSON representation
Plugin removes useless whitespaces and newlines in target json files
- Host: GitHub
- URL: https://github.com/unknownnpc/json-compressor-maven-plugin
- Owner: UnknownNPC
- License: mit
- Created: 2017-02-28T19:28:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-01-17T20:17:45.000Z (over 1 year ago)
- Last Synced: 2025-04-10T01:13:51.516Z (about 1 year ago)
- Topics: json, maven-plugin, newline, whitespace
- Language: Java
- Size: 47.9 KB
- Stars: 1
- Watchers: 1
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://codecov.io/gh/UnknownNPC/json-compressor-maven-plugin)
[](https://maven-badges.herokuapp.com/maven-central/com.github.unknownnpc.plugins/json-compressor)
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
```
com.github.unknownnpc.plugins
json-compressor
1.3
minify
${project.build.directory}/classes/large-file.json
${project.build.directory}/classes/large-files-*.json
${project.build.directory}/classes/large-files-3.json
```
Plugin is also support `skip` configuration parameter, eg. `true`.
#### 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"]}
```