SQL ジェネレーターの目標を openjpa プラグインに追加しようとしています。OpenJPA 2.2.0 を使用しています。pom.sql ファイルの次の関連部分を操作する jpa エンハンサーがあります。
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>${org.apache.openjpa.version}</version>
<configuration>
<includes>org/someorg/models/local/*.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<connectionDriverName>org.postgresql.Driver</connectionDriverName>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
<sqlFile>src/main/resources/sql/create.sql</sqlFile>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>${org.apache.openjpa.version}</version>
<executions>
<execution>
<id>enhancer</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<!-- set the version to be the same as the level in your runtime -->
<version>${org.apache.openjpa.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
次に、openjpa プラグインの実行部分に以下を追加しようとしました。
<execution>
<id>sql</id>
<phase>generate-resources</phase>
<goals>
<goal>sql</goal>
</goals>
</execution>
mvn -e install コマンドの実行中に次のエラーが発生します: http://pastebin.com/TENgXezJ
-e スイッチなしで実行する短いバージョン:
[ERROR]
Failed to execute goal org.apache.openjpa:openjpa-maven-plugin:2.2.0:sql(sql) on project batchpoc:
Execution sql of goal org.apache.openjpa:openjpa-maven-plugin:2.2.0:sql failed: MetaDataFactory could not be configured
(conf.newMetaDataFactoryInstance() returned null).
This might mean that no configuration properties were found.
Ensure that you have a META-INF/persistence.xml file, that it is available in your classpath,
or that the properties file you are using for configuration is available.
If you are using Ant, please see the <properties> or <propertiesFile> attributes of the task's nested <config> element. This can also occur if your OpenJPA distribution jars are corrupt,
or if your security policy is overly strict. -> [Help 1]
[ERROR]
私は何が欠けていますか?