- else
- getLog().info("No hibernate-properties-file found! (Checked path: " + hibernateProperties + ")");
- }
- catch (IOException e)
- {
- getLog().error("Error while reading properties!", e);
- throw new MojoExecutionException(e.getMessage());
- }
-
- /** Overwrite values from properties-file or set, if given */
- if (driverClassName != null)
- {
- if (properties.containsKey(DRIVER_CLASS))
- getLog().debug(
- "Overwriting property " +
- DRIVER_CLASS + "=" + properties.getProperty(DRIVER_CLASS) +
- " with the value " + driverClassName
- );
- else
- getLog().debug("Using the value " + driverClassName);
- properties.setProperty(DRIVER_CLASS, driverClassName);
- }
- if (url != null)
- {
- if (properties.containsKey(URL))
- getLog().debug(
- "Overwriting property " +
- URL + "=" + properties.getProperty(URL) +
- " with the value " + url
- );
- else
- getLog().debug("Using the value " + url);
- properties.setProperty(URL, url);
- }
- if (username != null)
- {
- if (properties.containsKey(USERNAME))
- getLog().debug(
- "Overwriting property " +
- USERNAME + "=" + properties.getProperty(USERNAME) +
- " with the value " + username
- );
- else
- getLog().debug("Using the value " + username);
- properties.setProperty(USERNAME, username);
- }
- if (password != null)
- {
- if (properties.containsKey(PASSWORD))
- getLog().debug(
- "Overwriting property " +
- PASSWORD + "=" + properties.getProperty(PASSWORD) +
- " with value " + password
- );
- else
- getLog().debug("Using value " + password + " for property " + PASSWORD);
- properties.setProperty(PASSWORD, password);
- }
- if (hibernateDialect != null)
- {
- if (properties.containsKey(DIALECT))
- getLog().debug(
- "Overwriting property " +
- DIALECT + "=" + properties.getProperty(DIALECT) +
- " with value " + hibernateDialect
- );
- else
- getLog().debug(
- "Using value " + hibernateDialect + " for property " + DIALECT
- );
- properties.setProperty(DIALECT, hibernateDialect);
- }
- else
- {
- hibernateDialect = properties.getProperty(DIALECT);
- }
- if ( hibernateNamingStrategy != null )
- {
- if ( properties.contains(NAMING_STRATEGY))
- getLog().debug(
- "Overwriting property " +
- NAMING_STRATEGY + "=" + properties.getProperty(NAMING_STRATEGY) +
- " with value " + hibernateNamingStrategy
- );
- else
- getLog().debug(
- "Using value " + hibernateNamingStrategy + " for property " +
- NAMING_STRATEGY
- );
- properties.setProperty(NAMING_STRATEGY, hibernateNamingStrategy);
- }