MPHIBERNATE-10 maven-hibernate ignores the "config" attribute

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115888 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
epugh 2004-07-25 13:49:38 +00:00
parent fc04278acc
commit 6d4aa4b2ae
5 changed files with 37 additions and 16 deletions

View File

@ -39,7 +39,7 @@ import net.sf.hibernate.tool.hbm2ddl.SchemaExport;
*
*
* @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
* @version $Id: SchemaExportBean.java,v 1.6 2004/07/23 10:35:13 epugh Exp $
* @version $Id: SchemaExportBean.java,v 1.7 2004/07/25 13:49:38 epugh Exp $
*/
public class SchemaExportBean extends CommonOperationsBean
{
@ -202,17 +202,16 @@ public class SchemaExportBean extends CommonOperationsBean
ClassLoader oldClassLoader = currentThread.getContextClassLoader();
try
{
if (getConfig() == null){
File [] baseDirs = getBaseDirs ();
URL [] urls = new URL [baseDirs.length];
for (int i = 0; i < urls.length; i++) {
urls [i] = baseDirs [i].toURL ();
}
URLClassLoader newClassLoader =
new URLClassLoader(urls, getClass().getClassLoader());
currentThread.setContextClassLoader(newClassLoader);
}
File [] baseDirs = getBaseDirs ();
URL [] urls = new URL [baseDirs.length];
for (int i = 0; i < urls.length; i++) {
urls [i] = baseDirs [i].toURL ();
}
URLClassLoader newClassLoader =
new URLClassLoader(urls, getClass().getClassLoader());
currentThread.setContextClassLoader(newClassLoader);
Configuration cfg = getConfiguration();
SchemaExport schemaExport = getSchemaExport(cfg);
@ -240,7 +239,7 @@ public class SchemaExportBean extends CommonOperationsBean
if (getConfig() != null)
{
File f = new File(getConfig());
LOG.debug("File" + f.getAbsolutePath());
LOG.debug("Hibernate Configuration File: " + f.getAbsolutePath());
cfg.configure(f);
}

View File

@ -22,12 +22,13 @@
xmlns:maven="jelly:maven"
xmlns:x="jelly:xml">
<goal name="testPlugin" prereqs="test-hibernate-schema-export-properties,test-hibernate-aggregate-mappings">
<goal name="testPlugin" prereqs="test-hibernate-schema-export-properties,test-hibernate-schema-export-configuration,test-hibernate-aggregate-mappings">
<attainGoal name="clean"/>
</goal>
<goal name="test-hibernate-schema-export-properties">
<j:set var="maven.hibernate.properties" value="${basedir}/src/main/hibernate.properties" />
<attainGoal name="clean"/>
<attainGoal name="jar"/>
<attainGoal name="hibernate:schema-export"/>
@ -37,6 +38,7 @@
<goal name="test-hibernate-schema-export-configuration">
<j:set var="maven.hibernate.config" value="${basedir}/target/classes/hibernate.cfg.xml" />
<attainGoal name="clean"/>
<attainGoal name="jar"/>
<attainGoal name="hibernate:schema-export"/>

View File

@ -60,6 +60,7 @@
<version>20030211.142705</version>
<url>http://jakarta.apache.org/commons/jelly/libs/xml/</url>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
@ -68,6 +69,24 @@
<type>jar</type>
</dependency>
<dependency>
<groupId>hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>2.1.3</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.0.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.4</version>
<type>jar</type>
</dependency>
</dependencies>
<build>

View File

@ -10,13 +10,13 @@
<session-factory>
<property name="connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="connection.url">jdbc:hsqldb:.</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
<property name="connection.pool_size">0</property>
<property name="show_sql">false</property>
<property name="dialect">org.hsqldb.jdbcDriver</property>
<property name="dialect">net.sf.hibernate.dialect.HSQLDialect</property>
<mapping resource="org/apache/maven/hibernate/Item.hbm.xml"/>

View File

@ -25,6 +25,7 @@
</properties>
<body>
<release version="1.2-SNAPSHOT" date="in CVS">
<action dev="epugh" type="fix" issue="MPHIBERNATE-10" due-to="Henning Schmiedehausen">maven-hibernate ignores the "config" attribute</action>
<action dev="epugh" type="fix" issue="MPHIBERNATE-11" due-to="Henning Schmiedehausen">maven-hibernate needs cglib when sending SQL directly to the database</action>
<action dev="epugh" type="fix" issue="MPHIBERNATE-7" due-to="Dion Gillard">Unit tests only functioned from the /src/plugin-test directory. plugin:test fails</action>
<action dev="epugh" type="add" issue="MPHIBERNATE-6" due-to="Alex Shnyderman">New aggregate-mappings goal to aggregate multiple .hbm files into one file.</action>