I may never know :) I had thought of a similar approach, but some JDBC drivers are actually mutliple jars...
On Fri, 2007-05-25 at 11:32 +0100, Pete wrote: > I'm not sure I understand at which point you do know these 'execution > environments' but maybe you could specify the values on the command > line along with a pom as follows :- > > > <dependency> > <groupId>${jdbc.groupId}</groupId> > <artifactId>${jdbc.artifactId}</artifactId> > <version>${jdbc.version}</version> > </dependency> > > and > > <hibernate-configuration> > <session-factory> > <!-- Database connection settings --> > <property > name="connection.driver_class">${jdbc.driverClassName}</property> > <property name="connection.url">${jdbc.url}</property> > <property name="connection.username">${jdbc.username}</property> > <property name="connection.password">${jdbc.password}</property> > <property name="dialect">${hibernate.dialect}</property> > <property name="show_sql">true</property> > </session-factory> > </hibernate-configuration> > > then specify the values using -Djdbc.driverClassName=etc > > or in the pom have a number of profiles that can be activated on demand e.g. > > <profile> > <id>mysql</id> > <activation> > <property> > <name>mysql</name> > <value>true</value> > </property> > </activation> > <properties> > <rdbms>mysql</rdbms> > <hibernate.dialect>org.hibernate.dialect.MySQLInnoDBDialect</hibernate.dialect> > <jdbc.groupId>mysql</jdbc.groupId> > <jdbc.artifactId>mysql-connector-java</jdbc.artifactId> > <jdbc.version>5.0.4</jdbc.version> > > <jdbc.driverClassName>com.mysql.jdbc.Driver</jdbc.driverClassName> > </properties> > </profile> > > > On 23/05/07, Steve Ebersole <[EMAIL PROTECTED]> wrote: > > I am looking to migrate Hibernate to use Maven for building. I am > > currently running into a problem porting the Hibernate testsuite. The > > Hibernate testsuite is mainly a bunch of functional and integration > > tests and not really unit tests per-se. But it is built on top of > > Junit. > > > > Anyway, the problem I am facing is in regards to the need to run the > > Hibernate test suite against multiple databases and JDBC drivers. > > Basically I need the ability to vary (1) Hibernate configuration and (2) > > test dependencies (jdbc drivers) per "environment". Logically one would > > think of profiles to help solve this, with one profile per > > "environment". And in fact defining all the profiles in the pom does > > in fact work, as i can separately define (1) dependencies and (2) > > resources (or properties) per profile. > > > > However, the trick is that I do not know all these execution > > environments up front. And thus I cannot define them in the pom. "user > > supplied" profiles.xmls would be an option, except that profiles.xml is > > not allowed to specify either of the two things I need (ok, ok, I could > > munge the requirements and get properties+resourceFilters to do the > > trick for Hibernate configuration). > > > > Anyone have any thoughts on how this may be achievable? > > > > Thanks, > > Steve > > > > > > --------------------------------------------------------------------- > > 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] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]