Posted by johnsmart
on August 13, 2008 at 4:29 PM PDT
SchemaSpy is a great little tool that lets you generate HTML entity-relationship diagrams for an existing database. Now there is a Maven plugin that lets you integrate SchemaSpy into your reports.
Schemaspy is a little known but very useful database analysis tool that generates an interactive graphical representation of your database structure, in terms of tables and relationships. This is a very cool tool that works wonders when you need to understand a new database structure. Indeed Schemaspy gets a chapter in the Java Power Tools book. A sample Schemaspy report can be found here .
If you have a Maven project, this is a great thing to have in your Maven reports. Unfortunately, there is no official Maven plugin for Schemaspy (at least, not for Maven 2). So, to get around this, I wrote my own. This plugin lets you generate SchemaSpy reports from within your pom.xml file - they appear in the Maven reports just like ordinary Javadoc documentation.
For the moment, this plugin is deployed in the Wakaleo Maven repository, so you need to add a reference to this repository in your POM file or your settings.xml file, as shown here:
The plugin is pretty easy to use: you just provide the details you would expect to access your database (JDBC URL, username, password,...). The full JDBC URL works fine. Or you can just provide the database name, type, and host address, which makes the configuration a bit lighter. The following listing illustrates how to use the plugin:
The plugin documentation can be found here . In particular, look at the usage page for more details on how to use the plugin.