Hi, On 5/26/05, phillip rhodes <[EMAIL PROTECTED]> wrote: > > I have a core project that encapsulates some domain > objects that I reuse in many of my projects. Many of > the domain objects use hibernate to be persisted. I > use the xdoclet and hibernate plugins to generate the > mapping files and create the tables in a schema. > > I reuse these core object relational mappings in many > other projects. Each project has its own schema, so I > need to create these core tables in each of the other > schemas.
Maybe I don't understand what you want to do, but this sounds more like a Hibernate problem than a Maven problem. I have projects with domain objects that are persisted with Hibernate, and reuse these projects in many other projects. I define all mapping files that are used in each project in that projects hibernate.cfg.xml (<mapping resource="..."/>). > So far, I have been copying the class files and > mapping files to each of these projects using a custom > maven plugin and running the hibernate:schema-export > goal for that individual project so that all the > necessary tables are created. I need to copy the > class files over or the hibernate plugin will not > work. I haven't tried any Hibernate plugins, but running org.hibernate.tool.hbm2ddl.SchemaExport with the option --config=".../hibernate.cfg.xml will generate your schema with all tables (as long as you have defined all the necassery mapping resources in the config and all the dependencies are in the classpath). So a Hibernate plugin for Maven should be able to handle this, but I haven't tried any. > While this works, I was interested in hearing how > other folks have dealt with using the hibernate goals > for a shared set of core objects across multiple > projects? > > A couple of drawbacks is that since I copy the class > and hbm files to my new projects, I am getting > unwanted classes in my new pom jar file (i would > rather just get the class file from the core project). > Another drawback (minor) is the time required to > regenerate the ddl from the mappings when this has > already been done in the core project. This doesn't sound like a good solution.. =) -- Kristian > > Interested in hearing your thoughts. > Thanks. > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]