Dependency Analyzer - User's documentation

Introduction

This project is a service, which provides information about built artifacts and analyse the projects' dependencies. It can lookup the Red Hat build artifacts and inform the users about alternatives instead of the artifacts used in their projects, produces dependency reports of artifacts and resolves dependency tree.

Dependency Analyzer also maintains a database of blocklisted artifacts, which should help the user to decide, which artifacts to use in their projects.

This project is hosted on GitHub and developed mainly by the JBoss Productization team, but external contributors are welcome.

Blocklist

The service maintains the database of the blocklisted artifacts. This data in the database can be changed ony by authenticated users. In future authorization may be added.

The meaning of the this lists is:

Lookup of built artifacts

Dependency Analyzer can lookup the Red Hat built artifacts and tell the user if an artifact was built or not and provide them alternative versions of the artifact. The user gets the information about:

Dependency reports

The system is able to provide information about the dependencies of a project. It can analyse a repository specified by the SCM URL (+ revision). This feature extends the lookup and it resolves whole dependency tree and provides information for every artifact in the tree and also some helper data like how many dependencies are not built.

Data source

Dependency Analyzer is using Indy, an artifact proxy for maven, to get information about built artifacts.

Currently data about built artifacts are gathered from the public product repository (maven.repository.redhat.com).

The integration with Brew/MEAD repositories is done and Indy will proxy also artifacts from the candidate tags.

Dependency Analyzer also provides built artifacts from the Project Newcastle build system.

Interfaces

Dependency Analyzer is a server side application and there are two ways how to use it. A REST API, which provides the main logic of the system and provides an easy way to use it in other applications. A CLI tool, which is more handy for the manual usage. The CLI tool is mainly a thin client, which gets all data from the service using the REST API.

REST API

The REST API is based on a Swagger documentation, which provides an easy way to have an up to date documentation and also a simple way to try the REST API from the browser. The path to the Swagger documentation is /da/doc. From this endpoint there is also link to the latest API version.

CLI tool

The CLI tool is more handy for the manual or script usage. Most of the data is obtained from the server application, so it is not possible to use the CLI tool without connection to the server. The tool is a collection of simple Python scripts, which requires to have installed interprets for Python 3.5 and above.

CLI tool manual

In this section will be described how to use the CLI tool and what are its options.

Installation

Options description

There is a couple of options, which can define the behavior of the CLI tool. The more complex options are described in this section. If you want to see description of all the available options you can find it in the help of the tool.

The output of the tool is delimited by the tab, but in this section the data are displayed in the list, which strictly conforms to the order of the output

Examples

List all artifacts in the whitelist
./da-cli.py list white
Add a product to whitelist
./da-cli-admin.py add whitelist-product eap:7.0.0 SUPPORTED
Add an artifact to whitelist
./da-cli-admin.py add white org.jboss.hibernate:hibernate-core:3.4.2.redhat-1 eap:7.0.0
Add several artifact to whitelist by reading G:A:Vs from standard input
./da-cli-admin.py add white eap:7.0.0 < gavfile.text
Remove an artifact from blocklist
./da-cli-admin.py delete black org.jboss.hibernate:hibernate-core:3.4.2
Check all dependencies from pom and print their black/white list status
./da-cli.py pom-bw <PATH_TO_DIRECTORY>
Check all dependencies from pom and print their report status
./da-cli.py pom-report <PATH_TO_DIRECTORY>
Lookup built versions of an artifact
./da-cli.py lookup org.hibernate:hibernate-core:4.2.18.Final
Create dependency report of an artifact
./da-cli.py report org.hibernate:hibernate-core:4.2.18.Final
Create SCM report for a project module
./da-cli.py scm-report https://github.com/jboss-fuse/fuse fuseenterprise-6.2.1.redhat-084 ./esb/pom.xml