hibernate3-maven-pluginを使用して、新しいデータベースにデータベーススキーマを作成するために使用できるSQLスクリプトを自動的に作成しました。私はhbm2ddlツールを介してこれを行います。SQLをファイルに書き込むように指示すると、50ページのSQLでMavenビルドが乱雑になるのを防ぐことができると思いました。とにかく、コンソールへの書き込みを停止してファイルへの書き込みのみを行うには?答えが見つかりません!
2 に答える
2
これをこのプラグインの構成に追加します。
<componentProperties>
...
<console>false</console>
...
</componentProperties>
于 2010-07-05T13:44:40.557 に答える
0
<plugin>
<!-- run "mvn hibernate3:hbm2ddl" to generate a schema -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>3.0</version>
<executions>
<execution>
<id>create-schema</id>
<phase>process-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<hibernatetool>
<classpath>
<path location="${project.build.directory}/classes" />
<path location="${project.basedir}/src/main/resources" />
</classpath>
<configuration configurationfile="${project.basedir}/src/main/resources/hibernate.cfg.xml"></configuration>
<hbm2ddl create="true" export="false" console="false" destdir="${project.basedir}/target" drop="true" outputfilename="mysql.sql" format="true" />
</hibernatetool>
</configuration>
</execution>
</executions>
</plugin>
「コンソール」と呼ばれるプロパティがあり、「false」として設定する必要があります
于 2014-01-09T10:07:38.350 に答える