maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ciaran Treanor <>
Subject How to checking properties are set?
Date Wed, 11 Dec 2002 11:00:47 GMT
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}"/>
   <java class="" fork="true">
       <arg value="${basedir}/src/java/blah/domain/*.hbm.xml"/>
       <jvmarg value="-Dhibernate.connection.driver_class=some.Driver"/>
       <jvmarg value="-Dhibernate.connection.username=username"/>
       <jvmarg value="-Dhibernate.connection.password=password"/>

The goal invokes the Hibernate ( 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/ (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?


View raw message