felipeal 2004/11/06 13:52:23
Modified: hibernate/xdocs goals.xml changes.xml
hibernate/src/plugin-test maven.xml
hibernate/src/main/org/apache/maven/hibernate/jelly
HibernateTagLibrary.java
hibernate plugin.jelly
Log:
MPHIBERNATE-13: added hibernate:schema-update
Revision Changes Path
1.5 +8 -1 maven-plugins/hibernate/xdocs/goals.xml
Index: goals.xml
===================================================================
RCS file: /home/cvs/maven-plugins/hibernate/xdocs/goals.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- goals.xml 2 Jul 2004 07:32:52 -0000 1.4
+++ goals.xml 6 Nov 2004 21:52:23 -0000 1.5
@@ -33,7 +33,14 @@
<tr>
<td>hibernate:schema-export</td>
<td>
- Creates SQL DDL file from set of *.hbm.xml files
+ Creates SQL DDL file and generates the database schema from set of
*.hbm.xml files
+ </td>
+ </tr>
+ <a name="hibernate:schema-update" />
+ <tr>
+ <td>hibernate:schema-update</td>
+ <td>
+ Updates the database schema based on the set of *.hbm.xml files
</td>
</tr>
<a name="hibernate:aggregate-mappings" />
1.22 +1 -0 maven-plugins/hibernate/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven-plugins/hibernate/xdocs/changes.xml,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- changes.xml 24 Sep 2004 12:01:52 -0000 1.21
+++ changes.xml 6 Nov 2004 21:52:23 -0000 1.22
@@ -25,6 +25,7 @@
</properties>
<body>
<release version="1.3" date="in cvs">
+ <action dev="felipeal" type="add" issue="MPHIBERNATE-13">Added new goal
<code>hibernate:schema-update</code></action>
<action dev="epugh" type="fix" issue="MPHIBERNATE-9">plugin:test fails
without a network connection</action>
</release>
<release version="1.2" date="2004-08-14">
1.7 +26 -1 maven-plugins/hibernate/src/plugin-test/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/maven-plugins/hibernate/src/plugin-test/maven.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- maven.xml 24 Sep 2004 12:00:37 -0000 1.6
+++ maven.xml 6 Nov 2004 21:52:23 -0000 1.7
@@ -22,9 +22,13 @@
xmlns:maven="jelly:maven"
xmlns:x="jelly:xml">
- <goal name="testPlugin"
prereqs="test-hibernate-schema-export-properties,test-hibernate-schema-export-configuration,test-hibernate-aggregate-mappings">
+ <goal name="testPlugin" prereqs="testSchemaExport,testSchemaUpdate,testAggregate">
<attainGoal name="clean"/>
</goal>
+
+ <goal name="testSchemaExport"
prereqs="test-hibernate-schema-export-properties,test-hibernate-schema-export-configuration"/>
+ <goal name="testSchemaUpdate"
prereqs="test-hibernate-schema-update-properties,test-hibernate-schema-update-configuration"/>
+ <goal name="testAggregate" prereqs="test-hibernate-aggregate-mappings"/>
<goal name="test-hibernate-schema-export-properties">
<j:set var="maven.hibernate.properties"
value="${basedir}/src/main/hibernate.properties" />
@@ -45,6 +49,27 @@
<assert:assertFileExists file="${maven.hibernate.output.file}"/>
</goal>
+
+ <goal name="test-hibernate-schema-update-properties">
+ <j:set var="maven.hibernate.properties"
value="${basedir}/src/main/hibernate.properties" />
+ <attainGoal name="clean"/>
+ <attainGoal name="jar"/>
+ <attainGoal name="hibernate:schema-update"/>
+
+ <!-- unfortunately goal does not generate a file output, so we cannot assert
anything -->
+
+ </goal>
+
+ <goal name="test-hibernate-schema-update-configuration">
+ <j:set var="maven.hibernate.config"
value="${basedir}/target/classes/hibernate.cfg.xml" />
+ <attainGoal name="clean"/>
+ <attainGoal name="jar"/>
+ <attainGoal name="hibernate:schema-update"/>
+
+ <!-- unfortunately goal does not generate a file output, so we cannot assert
anything -->
+
+ </goal>
+
<goal name="test-hibernate-aggregate-mappings">
<j:if test="${maven.mode.online}">
1.4 +2 -1
maven-plugins/hibernate/src/main/org/apache/maven/hibernate/jelly/HibernateTagLibrary.java
Index: HibernateTagLibrary.java
===================================================================
RCS file:
/home/cvs/maven-plugins/hibernate/src/main/org/apache/maven/hibernate/jelly/HibernateTagLibrary.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- HibernateTagLibrary.java 2 Jul 2004 07:32:52 -0000 1.3
+++ HibernateTagLibrary.java 6 Nov 2004 21:52:23 -0000 1.4
@@ -35,6 +35,7 @@
public HibernateTagLibrary()
{
registerTag( "schema-export", SchemaExportTag.class );
+ registerTag( "schema-update", SchemaUpdateTag.class );
registerTag( "aggregate-mappings", AggregateMappingsTag.class );
}
}
1.8 +14 -0 maven-plugins/hibernate/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/maven-plugins/hibernate/plugin.jelly,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- plugin.jelly 23 Jul 2004 10:35:13 -0000 1.7
+++ plugin.jelly 6 Nov 2004 21:52:23 -0000 1.8
@@ -54,6 +54,20 @@
includes="${maven.hibernate.input.includes}"
excludes="${maven.hibernate.input.excludes}"/>
</goal>
+
+ <goal name="hibernate:schema-update" prereqs="hibernate:init" description="Update
Hibernate schema">
+
+ <ant:echo>Updating database schema</ant:echo>
+
+ <h:schema-update
+ properties="${maven.hibernate.properties}"
+ config="${maven.hibernate.config}"
+ quiet="${maven.hibernate.quiet}"
+ text="${maven.hibernate.text}"
+ basedir="${maven.hibernate.input.dir}"
+ includes="${maven.hibernate.input.includes}"
+ excludes="${maven.hibernate.input.excludes}"/>
+ </goal>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]