https://github.com/amitjoy/dependency-graph-osgi
Dependency Graph in OSGi
https://github.com/amitjoy/dependency-graph-osgi
bnd dependency-graph graph osgi
Last synced: 3 months ago
JSON representation
Dependency Graph in OSGi
- Host: GitHub
- URL: https://github.com/amitjoy/dependency-graph-osgi
- Owner: amitjoy
- License: epl-2.0
- Created: 2018-10-04T06:48:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-05T22:07:30.000Z (over 1 year ago)
- Last Synced: 2024-10-12T10:24:58.976Z (8 months ago)
- Topics: bnd, dependency-graph, graph, osgi
- Language: Java
- Size: 235 KB
- Stars: 19
- Watchers: 4
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## Why? []()
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.
---------------------------------------------------------------------------------------------------------------------------------
### Requirements
Java 8+
### Contribution []()
Want to contribute? Great! Check out [Contribution Guide](https://github.com/amitjoy/dependency-graph-osgi/blob/master/CONTRIBUTING.md)---------------------------------------------------------------------------------------------------------------------------------
#### Project Import
**Import as Maven Project**
Import the project as an `Existing Maven Project` (`File -> Import -> Maven -> Existing Maven Projects`)
------------------------------------------------------------------------------------------------------------------------
#### Building from Source
1. Run `mvn clean package` in `com.amitinside.dependency.graph.osgi`
2. This will build the project
3. The target directory will contain `dependency.graph.osgi-0.0.1-SNAPSHOT-jar-with-dependencies.jar`------------------------------------------------------------------------------------------------------------------------
### License
This project is licensed under EPL-2.0 [](http://www.eclipse.org/legal/epl-2.0)
----------------------------------------------------------------------------------------------------------------------
### Usage
To use this application, you need an OBR (`OSGi Bundle Repository`) Index XML File.
#### OBR Index Generation
1. You need to download the bnd command line utility from https://search.maven.org/artifact/biz.aQute.bnd/biz.aQute.bnd
2. Using terminal, switch to your workspace directory and execute - `java -jar biz.aQute.bnd.jar index */target/*.jar`
3. This assumes that all the target artifacts are kept in `target` directory in the respective projects
4. Alternatively, you can copy all your project JARs inside a separate directory
5. Switch to this newly created directory in command line and execute `java -jar biz.aQute.bnd.jar index *.jar`
6. Both the aforementioned commands will generate OBR `index.xml` in the respective directories where the command is executed#### Create Bundles List
1. You need to have a file comprising the bundle symbolic names of the bundles whose dependencies will be plotted on the graph
2. 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 with `com.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 with `org.apache`.####
Help Command:
```
usage: Dependency Graph in OSGi - Help
-? Show Help
-bundles Bundle List File Location
-cycle Check for Cycle Existence
-debug Turn on Debug Mode
-edge Show Edge Labels
-help Show Help
-ns Namespace Type to Plot [ALL, PACKAGE, SERVICE,
IDENTITY, EE, NATIVE, CONTENT, IMPLEMENTATION,
CONTRACT, BUNDLE, HOST, CUSTOM] (Default ALL)
-ns_custom Custom Namespace (Needs to be set if ns option is set
to CUSTOM
-obr OBR Index File Location
```#### Example
`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
--------------------------------------------------------------------------------------------------------------
### Tools Used
1. https://bnd.bndtools.org
2. http://graphstream-project.org------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------