Hi,

I try to use Hibernate3 Maven plugin to generate DDL from JPA entities
bundled in a JAR. This JAR has a persistence.xml with no Hibernate dialect
set (it's because I want it to be database independant). Actually I use -D
option to set this dialect.
For example : mvn install
-Dhibernate.dialect=org.hibernate.dialect.HSQLDialect

Now I would like to set this system property in pom.xml. I tried with
<systemProperties> tag within plugin configuration (see below) but is
doesn't work. Anyone has an idea how I should do this ?

My pom.xml :

<project xmlns="http://maven.apache.org/POM/4.0.0";
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
      <modelVersion>4.0.0</modelVersion>
      <groupId>t4</groupId>
      <artifactId>t4-core-ddl</artifactId>
      <packaging>pom</packaging>
    <parent>
        <groupId>t4</groupId>
        <artifactId>t4-parent</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>
      <version>1.0-SNAPSHOT</version>
      <name>T4 Core DDL</name>
       <dependencies>
           <dependency>
            <groupId>t4</groupId>
            <artifactId>t4-core-all</artifactId>
            <version>${version}</version>
        </dependency>
           <dependency>
               <groupId>org.hibernate</groupId>
               <artifactId>hibernate-annotations</artifactId>
           </dependency>
           <dependency>
               <groupId>org.hibernate</groupId>
               <artifactId>hibernate-entitymanager</artifactId>
           </dependency>
       </dependencies>
    <build>
          <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                   <artifactId>hibernate3-maven-plugin</artifactId>
                   <configuration>
                    <componentProperties>
                        <drop>false</drop>
                        <export>false</export>
                        <outputfilename>t4-core.sql</outputfilename>
                       </componentProperties>
                       <components>
                           <component>
                               <name>hbm2ddl</name>

<implementation>jpaconfiguration</implementation>
                        </component>
                    </components>
                    <systemProperties>
                         <property>
                            <name>hibernate.dialect</name>
                            <value>org.hibernate.dialect.HSQLDialect</value>
                        </property>
                    </systemProperties>
                </configuration>
                <executions>
                    <execution>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>hbm2ddl</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
      </build>
</project>

Thanks in advance,

Olivier

Reply via email to