質問

Hibernate3-Maven-Pluginを使用して、新しいデータベースでデータベーススキーマを作成するために使用できるSQLスクリプトを自動的に作成しました。 HBM2DDLツールを介してこれを行います。 SQLをファイルに書き込むように指示したとき、50ページのSQLで私のMavenビルドの乱れを止めるだろうと思いました。とにかくコンソールへの書き込みを停止させ、ファイルにのみ書き込むのですか?答えが見つかりません!

役に立ちましたか?

解決

このプラグインの構成にこれを追加します。

<componentProperties>
  ...
  <console>false</console>
  ...
</componentProperties>

他のヒント

<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」として設定する必要があります

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top