maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ciaran Treanor <cia...@capetechnologies.com>
Subject How to checking properties are set?
Date Wed, 11 Dec 2002 11:00:47 GMT
Hi,
I've got a maven.xml with a goal like this:
<goal name="createdb">
   <path id="db.classpath">
     <pathelement path="target/classes"/>
     <path refid="${maven.dependency.classpath}"/>
   </path>
   <java class="cirrus.hibernate.tools.SchemaExport" fork="true">
       <arg value="${basedir}/src/java/blah/domain/*.hbm.xml"/>
       <jvmarg 
value="-Dhibernate.dialect=cirrus.hibernate.sql.SybaseDialect"/>
       <jvmarg value="-Dhibernate.connection.driver_class=some.Driver"/>
       <jvmarg 
value="-Dhibernate.connection.url=jdbc:foo://server2/ct_hibernate"/>
       <jvmarg value="-Dhibernate.connection.username=username"/>
       <jvmarg value="-Dhibernate.connection.password=password"/>
   </java>
</goal>

The goal invokes the Hibernate (hibernate.sourceforge.net) SchemaExport
tool which causes the schema defined by the .hbm.xml files to be
created in the specified database.

Each subproject's maven.xml will have an almost identical goal (the
only thing that will change is the <arg>. So, I have two questions:
1. Is there way to define a "createdb" task in a project-wide maven.xml
    file so that I can reuse the task across sub-projects without having
    to cut'n'paste the above xml?
2. I'm going to move the driver_class, url, username and password to
    $HOME/build.properties (so that this information can be shared
    across sub-projects), for example:
    <jvmarg value="-Dhibernate.connection.driver_class=${MY_DRIVER}"/>
    How/where should I check that MY_DRIVER is set?

Thanks,
ct



Mime
View raw message