/**
* Target of execution:
* <ul>
- * <li><strong>NONE</strong> do nothing - just validate the configuration (forces excecution, signals skip)</li>
- * <li><strong>EXPORT</strong> create database (<strong>DEFAULT!</strong>. forces excecution, signals skip)</li>
- * <li><strong>SCRIPT</strong> export schema to SQL-script</li>
+ * <li><strong>NONE</strong> only export schema to SQL-script (forces excecution, signals skip)</li>
+ * <li><strong>EXPORT</strong> create database (<strong>DEFAULT!</strong>). forces excecution, signals skip)</li>
+ * <li><strong>SCRIPT</strong> export schema to SQL-script and print it to STDOUT</li>
* <li><strong>BOTH</strong></li>
* </ul>
*
+ * A databaseconnection is only needed for EXPORT and BOTH, but a
+ * Hibernate-Dialect must always be choosen.
+ *
* @parameter property="hibernate.export.target" default-value="EXPORT"
*/
private String target;
* <li><strong>BOTH</strong> (<strong>DEFAULT!</strong>)</li>
* </ul>
*
+ * If NONE is choosen, no databaseconnection is needed.
+ *
* @parameter property="hibernate.export.type" default-value="BOTH"
*/
private String type;
MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
for (String filename : hibernateMapping.split("[\\s,]+"))
{
- File file = null;
- for (Resource resource : project.getResources())
+ // First try the filename as absolute/relative path
+ File file = new File(filename);
+ if (!file.exists())
{
- file = new File(resource.getDirectory() + File.separator + filename);
- if (file.exists())
- break;
+ // If the file was not found, search for it in the resource-directories
+ for (Resource resource : project.getResources())
+ {
+ file = new File(resource.getDirectory() + File.separator + filename);
+ if (file.exists())
+ break;
+ }
}
if (file != null && file.exists())
{
* hibernate does not use the context-classloader of the current
* thread and, hence, would not be able to resolve the driver-class!
*/
+ getLog().debug("Target: " + target + ", Type: " + type);
switch (target)
{
case EXPORT: