An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

[![codecov](https://codecov.io/gh/UnknownNPC/json-compressor-maven-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/UnknownNPC/json-compressor-maven-plugin)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.unknownnpc.plugins/json-compressor/badge.svg)](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"]}
```