Hi Johann,
I would again suggest that the scanner code should have
"include/exclude" capability and that it also scans "compile"
dependency jar files for annotated classes.
The rational for this is that the default behaviour would be the 99%
case where the developer wants all
the annotated classes processed but allowing the developer to control
which classes are processed. I think
this follows the "configuration by convention" philisophy but allows
the developer to work around unintended
consequences of including dependencies required for compilation that
have persistence annotations not required
to build / test the module under development.
David Bernard
Geoffrey De Smet wrote:
Well, when using the EntityManager directly and a persistence.xml
file, you can let the classloader find all annotated classes too,
without having to mention them. It's actually the default IRCC.
And since it would make my life easier too, not to have to mention all
my annotated classes, I 'd vote +1 of course :)
Johann Reyes wrote, On 2006-12-13 6:56 PM:
Hello Geoffrey
Yeah, before I was allowing no to specify hibernate.cfg.xml because I
manually scanned for annotated classes and there was no need for it.
Now this revision I'm trying to follow up what the ant plugin is
doing, and
basically annotated classes need hibernate.cfg.xml.
So I guess it's vote time again: do I put back the scanner for annotated
classes back on the plugin or just follow up the standards, and file an
improvement with hibernate-tools to see if this can be added to it?
Btw, if you decide to add hibernate.cfg.xml, you can basically put the
values in hbm2ddl.properties inside hibernate.cfg.xml so you wouldn't
need
these two files, only one.
And thanks for the words, just happy to be able to give something
back to
the community.
Regards
Johann Reyes
-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey De Smet
Sent: Wednesday, December 13, 2006 11:00 AM
To: dev@mojo.codehaus.org
Subject: [mojo-dev] [hibernate3-maven-plugin] No configurationfile in
configurationTaskProperties
It took me a while to get some time to test out the new snapshot,
but I finally had some time :)
I am using annotations for my classes and I don't have a
hibernate.cfg.xml (I don't have a persistence.xml file either - I am
doing everything in a Spring configuration).
This used to work, but now I get this error:
[INFO] [hibernate3:hbm2ddl {execution: default}]
[INFO] src/main/resources/hibernate.cfg.xml not found within the
project. Trying absolute path.
[INFO] No hibernate configuration file loaded.
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] No hibernate.cfg.xml configuration provided. Annotated
classes/packages is only configurable via hibernate.cfg.xml
Here's my config:
<configurationTaskProperties>
<propertyfile>/src/main/hibernate3/hbm2ddl.properties</propertyfile>
<namingstrategy>org.hibernate.cfg.DefaultComponentSafeNamingStrategy</naming
strategy>
</configurationTaskProperties>
Should I make a
/src/main/hibernate3/hibernate.cfg.xml
especially for the plugin (like I did with the hbm2ddl.properies)?
Thanks for your continued work and help on this list, Johann.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email