Announcing the new Maven Schemaspy Plugin
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:
<pluginRepositories> ... <pluginRepository> <id>Wakaleo Repository</id> <url>http://maven.wakaleo.com/repos/</url> </pluginRepository> ... </pluginRepositories>
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:
<project> ... <reporting> <plugins> <plugin> <groupId>com.wakaleo.schemaspy</groupId> <artifactId>maven-schemaspy-plugin</artifactId> <version>1.0</version> <configuration> <databaseType>mysql</databaseType> <database>testdb</database> <host>localhost</host> <user>scott</user> <password>tiger</password> </configuration> </plugin> </plugins> </reporting> </project>