Added all important commandline options. Updated documentation.
[javainspect.git] / README.md
1 # JavaInspect
2
3 Visualize java class relationships as Graphviz.
4
5 Forked from the original work from [Svjatoslav Agejenko](http://www.svjatoslav.eu/).
6 This repository only provides minor improvements.
7
8 Original [git repository](http://www2.svjatoslav.eu/repositories/javainspect.git)
9
10 Original [documentation](http://www2.svjatoslav.eu/gitbrowse/javainspect/doc/index.html)
11
12 Minor enhancements:
13
14 - Provides java main to run as CLI tool.
15 - Produces single executable with dependencies.
16 - Default to render SVG.
17 - Default to output to `user.dir` (i.e. working directory).
18
19 ### Building
20
21 1. Install [Maven](http://maven.apache.org/).
22 2. Package JAR:
23
24     `mvn clean package`
25
26 ### Running
27
28 1. You will need to add the classes would like to visualize to your classpath.
29 2. Provide a package glob pattern to identify the classes you want to visualize.
30 3. Name your output.
31
32 ```bash
33 java \
34   -cp .:./example/target/myproject-0.0.jar:./target/javainspect-1.6-SNAPSHOT.jar \
35   eu.svjatoslav.inspector.java.methods.Main \
36   ./example/src/main/java/ com.myproject.* myproject
37 ```
38
39 Here we want to visualize _com.myproject.*_ classes found in
40 *./example/src/main/java/*. The resulting *dot* and *svg*
41 file will be prefixed with *myproject*.
42
43 ### Output example
44
45 ![MyProject output](https://github.com/abargnesi/javainspect/raw/master/myproject.png)
46
47 The [dot](https://github.com/abargnesi/javainspect/raw/master/myproject.dot) file is also saved.