diff-to-html

Display diffs in a convenient html page

License

License

GroupId

GroupId

de.cronn
ArtifactId

ArtifactId

diff-to-html
Last Version

Last Version

1.6
Release Date

Release Date

Type

Type

jar
Description

Description

diff-to-html
Display diffs in a convenient html page
Project URL

Project URL

https://github.com/cronn-de/diff-to-html
Source Code Management

Source Code Management

https://github.com/cronn-de/diff-to-html

Download diff-to-html

How to add to project

<!-- https://jarcasting.com/artifacts/de.cronn/diff-to-html/ -->
<dependency>
    <groupId>de.cronn</groupId>
    <artifactId>diff-to-html</artifactId>
    <version>1.6</version>
</dependency>
// https://jarcasting.com/artifacts/de.cronn/diff-to-html/
implementation 'de.cronn:diff-to-html:1.6'
// https://jarcasting.com/artifacts/de.cronn/diff-to-html/
implementation ("de.cronn:diff-to-html:1.6")
'de.cronn:diff-to-html:jar:1.6'
<dependency org="de.cronn" name="diff-to-html" rev="1.6">
  <artifact name="diff-to-html" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.cronn', module='diff-to-html', version='1.6')
)
libraryDependencies += "de.cronn" % "diff-to-html" % "1.6"
[de.cronn/diff-to-html "1.6"]

Dependencies

compile (6)

Group / Artifact Type Version
org.apache.commons : commons-text jar 1.2
commons-cli : commons-cli jar 1.3
commons-io : commons-io jar 2.6
com.j2html : j2html jar 1.2.2
io.github.java-diff-utils : java-diff-utils jar 4.7
com.googlecode.juniversalchardet : juniversalchardet jar 1.0.3

Project Modules

There are no modules declared in this project.

Build Status Maven Central Apache 2.0

diff-to-html

Displays diffs in a convenient html page.

  • Useful when dealing with large validation text files or directory structures in automated builds, e.g. on Jenkins.
  • Collapsible diff sections for each file make the result easy to read when comparing directories
  • Inline-diff (character-wise) helps you to easily identify changes (optionally line-wise)
  • Pure Java solution
Example outputs:

cronn-diff-to-html_outputExample3 cronn-diff-to-html_outputExample2

Usage

Install:

$ ./gradlew installDist

To compare two directories (or files), e.g. dir1 and dir2, use the fat jar

$ java -jar build/libs/diff-to-html-1.1.jar dir1 dir2

or the start script

$ ./build/install/diff-to-html/scripts/diff-to-html dir1 dir2

which will give you something like

Output written to: file:///home/maurice/Git-Projects/openSource/diff-to-html/diff_dir1_dir2.html

Directories differ!

Call without arguments for help

$ java -jar build/libs/diff-to-html-1.4.jar -h
usage: cronn-diff-to-html <input_left> <input_right> [<output_html>]  [-h]
       [-w] [-b] [-crlf] [-or] [-iu] [-de] [-u <arg>] [-fs <arg>] [-id]
 -h,--help                     print this help
 -w,--ignore-white-spaces      ignore all white spaces
 -b,--ignore-space-change      ignore changes in the amount of white space
 -crlf,--ignore-line-endings   ignore line endings, i.e. normalize CRLF /
                               LF while comparing files
 -or,--only-reports            always exits with zero
 -iu,--ignore-unique           ignore unique files
 -de,--detect-encoding         tries to determine encoding type
 -u,--unified <arg>            output <arg> (default 3) lines of unified
                               context
 -fs,--max-size-diff <arg>     no textual diff if file size differs too
                               much
 -id,--line-diff               generate line-wise diffs (default: inline /
                               character-wise)

Generate your tar (or zip) to take wherever you want

$ ./gradlew distTar distZip
$ ls build/distributions/
diff-to-html-1.1.tar  diff-to-html-1.1.zip

Prerequisites

  • Java 8

Related

Versions

Version
1.6
1.5
1.4
1.3
1.2
1.1
1.0