|
[
Permalink
| « Hide
]
Anno Langen added a comment - 31/Jan/07 11:21 AM
Changing the phase of hbm2dll also appears to solve a second lifecycle problem that I find more difficult to distill. "mvn site" failed with ClassNotFoundError for new entries in hibernate.cfg.xml when hbm2dll was running after cobertura.
Matt Raible made changes - 31/Jan/07 12:43 PM
Changing the hibernate3 plugin to use the "process-test-resources" phase seems like the most appropriate fix - as it executes just before "test-compile". BTW, in the most recent versions of AppFuse 2.x, the dbunit plugin is executed twice:
<executions> <execution> <id>test-compile</id> <phase>test-compile</phase> <goals> <goal>operation</goal> </goals> </execution> <execution> <!-- Runs before integration tests and jetty:run-war --> <id>test</id> <phase>test</phase> <goals> <goal>operation</goal> </goals> </execution> </executions> According to the Maven team, order is not guaranteed for plugins that use the same phase. I just confirmed that process-test-resources does solves the problem I reported. But unlike phase, process-classes, it does not solve my other Maven life cycle problem. It is "mvn site" when the application has defined an additional model class. Why not process-classes? The description of that phase in http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html seems to fit.
And finally, there is the support for edit/compile without unit testing, which "mvn jetty:run" would enable if the schema were altered as part of process-classes.
Matt Raible made changes - 31/Jan/07 03:11 PM
I'll change it to "process-classes", but I don't understand why it causes a problem with mvn site and mvn jetty:run. All this plugin does is generate a database tables. I almost wish it didn't run if the database tables existed since it spits out a ton of output.
I don't understand the problem with mvn site either, but the phase of hbm2dll is a trigger.
As for jetty:run, I now see that hbm2dll does not alter tables, it merely tries to create them. Plus it turns out jetty:run requires "compile" but not "process-classes". Please forget my jetty:run argument. Maybe I should just deviate in my project's copy of pom.xml until I understand the deeper problem with mvn site. Changed phase to process-classes for now - please let me know if process-test-resources turns out to be the better solution.
Matt Raible made changes - 31/Jan/07 06:26 PM
Reopening since process-classes phase causes the following issue with the hibernate module:
[INFO] target/test-classes/jdbc.properties not found within the project. Trying absolute path. [INFO] No hibernate properties file loaded. [INFO] ------------------------------------------------------------------------ [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] The dialect was not set. Set the property hibernate.dialect. [INFO] ------------------------------------------------------------------------ [INFO] Trace org.hibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect. Changing to process-test-resources should fix this problem.
Matt Raible made changes - 31/Jan/07 06:40 PM
Matt Raible made changes - 05/Feb/07 05:00 PM
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||