This is an easy to use tool to visualize OSGi Dependencies in a graph. In addition, this tool also supports detection of cyclic dependencies in the plotted graph. The primary goal is to minimize the effort in analyzing big software projects based on OSGi.
Java 8+
Want to contribute? Great! Check out Contribution Guide
Import as Maven Project
Import the project as an Existing Maven Project
(File -> Import -> Maven -> Existing Maven Projects
)
- Run
mvn clean package
incom.amitinside.dependency.graph.osgi
- This will build the project
- The target directory will contain
dependency.graph.osgi-0.0.1-SNAPSHOT-jar-with-dependencies.jar
This project is licensed under EPL-2.0
To use this application, you need an OBR (OSGi Bundle Repository
) Index XML File.
- You need to download the bnd command line utility from https://search.maven.org/artifact/biz.aQute.bnd/biz.aQute.bnd
- Using terminal, switch to your workspace directory and execute -
java -jar biz.aQute.bnd.jar index */target/*.jar
- This assumes that all the target artifacts are kept in
target
directory in the respective projects - Alternatively, you can copy all your project JARs inside a separate directory
- Switch to this newly created directory in command line and execute
java -jar biz.aQute.bnd.jar index *.jar
- Both the aforementioned commands will generate OBR
index.xml
in the respective directories where the command is executed
- You need to have a file comprising the bundle symbolic names of the bundles whose dependencies will be plotted on the graph
- You can create a
bundles.txt
(or give it a name of your choice) with bundle symbolic names in separate lines. You can also use wildcards. For example,com.google.*
will consider all the bundles whose symbolic names start withcom.google.
Apart from it, you can also use negations. For example,!org.apache*
would remove all the bundles from the Graph whose symbolic names start withorg.apache
.
Help Command:
usage: Dependency Graph in OSGi - Help
-? Show Help
-bundles <arg> Bundle List File Location
-cycle Check for Cycle Existence
-debug Turn on Debug Mode
-edge Show Edge Labels
-help Show Help
-ns <arg> Namespace Type to Plot [ALL, PACKAGE, SERVICE,
IDENTITY, EE, NATIVE, CONTENT, IMPLEMENTATION,
CONTRACT, BUNDLE, HOST, CUSTOM] (Default ALL)
-ns_custom <arg> Custom Namespace (Needs to be set if ns option is set
to CUSTOM
-obr <arg> OBR Index File Location
java -jar dependency.graph.osgi-0.0.1-SNAPSHOT-jar-with-dependencies.jar -obr index.xml -bundles bundles.txt -edge
- Plot the matched bundles from bundles.txt using the specified OBR index.xml with edge labels