hibernate3-maven-plugin を使用して persistence.xml の JPA エンティティを読み取り、DDL データベース スクリプトを作成して、テーブルをデータベースに挿入できるようにしようとしています。以下の最初の maven プラグイン構成は機能し、DDL スクリプトを作成しますが、pom.xml を Eclipse で表示すると厄介なライフサイクル構成エラーが発生します。以下のプラグインの 2 番目の構成 (lifecycleMappingMetadata を使用する構成) を使用しようとしましたが、DDL スクリプトが作成されず、クリーン インストールを実行してもエラーは発生しません。何か案は?
Eclipse XML 検証エラー:
Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm2ddl (execution: default, phase:
compile)
動作しますが、Eclipse XML Validation ライフサイクル構成エラーがあります:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
</execution>
</executions>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>jpaconfiguration</implementation>
</component>
</components>
<componentProperties>
<persistenceunit>myapi</persistenceunit>
<outputfilename>my.sql</outputfilename>
<drop>false</drop>
<create>true</create>
<export>false</export>
<format>true</format>
</componentProperties>
</configuration>
</plugin>
機能しない lifecycleMappingMetadata:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<versionRange>[2.2,)</versionRange>
<phase>compile</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
<components>
<component>
<name>hbm2ddl</name>
<implementation>jpaconfiguration</implementation>
</component>
</components>
<componentProperties>
<persistenceunit>denaliapi</persistenceunit>
<outputfilename>denali.sql</outputfilename>
<drop>false</drop>
<create>true</create>
<export>false</export>
<format>true</format>
</componentProperties>
</configuration>
</plugin>