[
http://jira.codehaus.org/browse/MOJO-798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_96249
]
John Ferguson Smart commented on MOJO-798:
------------------------------------------
I just added a jdbcUrl configuration option, which lets you specify the JDBC
URL directly rather then counting on SchemaSpy to generate it.
To give a better idea of how the plugin works, here is a copy of the web site
usage page:
The SchemaSpy plugin generates SchemaSpy reports describing a relational
database. It will look for an appropriate JDBC driver on the classpath (based
on the database type), and by default will generate a report in the
'target/site/schemaspy' directory. To include a report in your project site,
set the following in the <reporting> section of your pom:
<project>
...
<reporting>
<plugins>
<plugin>
<groupId>com.wakaleo.maven.plugin.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>
Configuration
SchemaSpy (see JXR plugin) . The SchemaSpy plugin accepts all of the standard
SchemaSpy parameters.
Most databases with JDBC drivers available in the standard Maven repository
should work out-of-the-box. Currently, these are: * Derby * MySQL * HSQLDB *
PostgreSQL * MS SQLServer using the JTDS driver (mssql-jtds) Others, such as
DB2, Oracle, MS SQL Server (if using the Microsoft driver) and Firefox, don't
have drivers in the repositories.
In this case, or if you want to specify a different driver, you need to specify
the driver manually using the <pathToDrivers> parameter:
<project>
...
<reporting>
<plugins>
<plugin>
<groupId>com.wakaleo.maven.plugin.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>
<outputDirectory>target/site/schemaSpy-full</outputDirectory>
<pathToDrivers>src/test/resources/lib/derby-10.1.2.1.jar</pathToDrivers>
<commentsInitiallyDisplayed>true</commentsInitiallyDisplayed>
<noTableComments>true</noTableComments>
<noImplied>true</noImplied>
<allowHtmlInComments>true</allowHtmlInComments>
<cssStylesheet>testSchemaSpy.css</cssStylesheet>
<schemaDescription>Maven Plugin SchemaSpy Test</schemaDescription>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
For MSSQL Server, the mssql-jtds will use the open source JTDS driver for this
database.
Rather than defining the database and host names and letting SchemaSpy build
the URL, you can alternatively specify the complete JDBC URL using this
parameter. If this parameter is defined, it will override the host address
(which, as a result, is not needed). Note that you still need to specify the
database type, since SchemaSpy uses its own database properties file for extra
information about each database.
<project>
...
<reporting>
<plugins>
<plugin>
<groupId>com.wakaleo.maven.plugin.schemaspy</groupId>
<artifactId>maven-schemaspy-plugin</artifactId>
<version>1.0</version>
<configuration>
<databaseType>mysql</databaseType>
<jdbcUrl>jdbc:mysql://localhost/testdb</jdbcUrl>
<user>scott</user>
<password>tiger</password>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
As a rule, it is not a good idea to keep usernames and passwords in the source
code repository. An alternative is to define the user and password values in
your setting.xml file, as shown here:
<settings>
<localRepository>C:/maven/repository</localRepository>
<profiles>
<profile>
<id>development</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<schemaspy.username>john</schemaspy.username>
<schemaspy.password></schemaspy.password>
</properties>
</profile>
</profiles>
</settings>
With this setup, you can use the $schemaspy.username and $schemaspy.password
values directly in your SchemaSpy plugin configuration:
<project>
...
<reporting>
<plugins>
<plugin>
<groupId>com.wakaleo.maven.plugin.schemaspy</groupId>
<artifactId>maven-schemaspy-plugin</artifactId>
<version>1.0</version>
<configuration>
<database>testdb</database>
<jdbcUrl>jdbc:mysql://localhost/testdb</jdbcUrl>
<user>${schemaspy.username}</user>
<password>${schemaspy.password}</password>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
> A Maven 2 plugin for the SchemaSpy
> -----------------------------------
>
> Key: MOJO-798
> URL: http://jira.codehaus.org/browse/MOJO-798
> Project: Mojo
> Issue Type: New Feature
> Components: Plugin Submission
> Reporter: John Ferguson Smart
>
> I've just written a Maven 2 plugin for SchemaSpy
> (http://schemaspy.sourceforge.org) that I'd like to put onto Codehaus. This
> plugin allows you to automatically run the SchemaSpy database analysis tool
> on a database and generate a site report with its results. SchemaSpy
> generates a detailed graphical and HTML report describing a given relational
> database, including entity-relation diagrams and hyperlinked HTML
> descriptions of tables and columns.
> The source code is currently available at:
> https://wakaleo.devguard.com/svn/maven-plugins/maven-schemaspy-plugin/trunk
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email