This summer, Piotr Tabor and Peter Kolbus will create (as Google Summer of Code participants - with Jason van Zyl and Carlos Sanchez as mentors respectively) a software system that will allow graphs of Maven project information to be created, both interactively and during the build process of a project.  This includes:

The WORK IN PROGRESS code connected to this proposal is in the mojo sandbox:

Previous work

See for previous work and discussions, to reuse as much as possible

Why "Maven Diagram Maker"?

There are no good, free tools to prepare diagrams - especially such that would automatically generate diagrams from the source code and project descriptors. On the other hand, good and up-to-date documentation is a very important part of software development process - particularly in the Open Source world, where documentation is critical to help many people work on projects. On the other hand, nobody likes preparing documents and diagrams. To make the matters worse, using standard one-time diagrammers helps only for a short period of time. In fast growing projects, the pictures become obsolete very quickly. They start to mislead. Therefore I think that adding possibility to generate actual up-to-date diagrams in the build process is a very important idea - and Maven is the perfect environment to do that.

Java developers can nowadays use very good text documenting tools, such a JavaDoc and Doxia, but the lack of methods to prepare and incorporate actual visual information in the documents is a very serious shortcoming of those tools.

Why "Dependency Troubleshooting"?

In larger software projects, it becomes difficult to ensure versions of dependencies are consistent throughout the component hierarchy.  The dependency troubleshooter will provide the software developer with the information needed to find and fix dependency problems:

Project Timeline


Graph Structures


Graphs of Java Classes


Graphs of Artifact Dependencies


Graph Connectors and Listeners

A Connector provides a source of information about the structure of a graph; a Listener receives this information and creates a representation for output. The connector/listener model is used because graph structure information can often only be learned incrementally; for example, Maven's artifact resolution process never provides the overall structure of all dependencies, it only fires events as each artifact is scanned for dependencies.  The connector model also allows


Events fired by a Connector include:

Connector Configuration

The configuration of a connector will be described in XML format, via a dataSource tag.  The dataSource describes the groupId and artifactId of the connector, as well as a container tag for the details of the configuration.  The specific tags used in the configuration tag will be different for each connector, but common tag names will be used whenever appropriate.

                  <!-- details for a particular connector -->

Connector Implementations

The following connectors will be implemented as part of this project:

Of course the mechanism of the connectors will be universal enough to make the addition of a new aspect of a project as simple as possible.

Class Diagram Connector 

The class diagram connector will inspect the classes in a directory, *.jar or *.war file and allowing to limit them. The information will be obtained from the classes by reflection.

Proposed configuration:


           <!-- keepEdges means: nodes: A,B,C; graph: A-B-C,
                result of "exclude B" with keepEdges: A-C.
                result of "exclude B' without keepEdges: A-C
                The first rule wins.
                (default: false)
           <exclude keepEdges="true/false">org\.apache\.maven.*<\exclude>

            <!--if a class contains x,getX, setX, it will be represented only as "&lt;property&gt; x" -->
            <compressJavaBeanProperties>true/false (default true)<compressJavaBeanProperties>

            <!-- if a superclass of a class contains (public or protected) methods - should the methods be visible in the inherited class -->
            <propagateInheritedMethods>true/false (default false)</propagateInheritedMethods>

            <!-- if a superclass of a class contains (public or protected) fields - should the fields be visible in the inherited class -->
            <propagateInheritedFields>true/false (default false)</propagateInheritedFields>



Dependency connector

Providing data about project dependencies and allowing to limit them. In implementation it will be very similar to the "dependencies" task of maven-help-plugin

Proposed configuration:

		<excludesTransitives>   <!-- Do not expand transitive dependencies of the artifacts:-->
			<include>.*<!-- default -->		</includes>

Dependency Diff Connector


The Graphical Editor

'The Graphical Editor will offer live (WYSIWYG) preparation of a graphical presentation of the project by setting such properties as:

Planned editor features

The Graphical Editor will help the user create and edit the visualization schema XML file. The file will contain two types of information:

-The <view> section will describe how to present data. In details it
will contain:

"View" tag schema proposition (example):

		<class>prefuse.action.layout.graph.ForceDirectedLayout<!--or other layout class--></class>
			<duration>1000</duration> <!-- how long (how many iterations) the forces have to be simulated-->
		<label x="10" y="15">Label1</label>
		<label x="20" y="25">Label2</label>
	<crop> <!--perspective (coordinates of the visible area in the picture) f omited whole diagram has to fit into the picture -->

The editor will be using a Prefuse library ( In particular, all strategies of automatic object positioning provided by the library will be available for the user. The only connection between Maven and the editor will be the data source component (the connector). Out of the two connectors I wish to create only one (the dependencies view) will be dependent on Maven, the other (class hierarchy view) will be Maven-independent. Thus the editor may be viewed as a universal tool to browse and explore all kinds of data through the Prefuse library and to prepare visualization template files. This means the editor could be used in a wide variety of cases, provided an appropriate connector is supplied.

The Maven Plug-in (maven-graph-plugin)

The Maven Plug-in will be using the XML file prepared by the Graphical Editor and the current state of project to prepare images in various graphic formats (JPG, TIFF, PNG and others
supported by the Sun JAI library ( The plug-in will be able to prepare the HTML <map> tag for the picture too (to create an active area on web page containing the image). The resulting file will be ready to use in the next Maven phases by Doxia or other documenting tool.

The maven-graph-plugin will cope with changes in the project made after generating the schema XML file. This means that if an object from the XML file is no longer exists in the project, it won't be visible in the picture. It also means that if the object is new, it will be placed in the picture (in a place calculated by the general layout strategy set in the XML file). Additionally the user will be warned about any discrepancies between the expected and actual data and problems with finding space for a new object. The diagram generation will not modify the XML file, but will only try to interpret it for the current situation.

Planned Features

The Maven-graph-plugin will be a tool to join the visualization XML file created by the editor with current project data (or other information described in <dataSource> section) and as a result to collection of graphical files in chosen formats (provided by Sun JIMI library: The result of the plug-in would be also a HTML <map> tag - to support active links on the generated image. Configuration of result file formats, sizes in pixels, file names and destinations directory will be provided in the plug-in configuration.

Dependency Troubleshooting

TBD: See for now.