使用JDO的Maven GAE插件

时间:2011-08-28 17:42:49

标签: google-app-engine maven jdo

我正在使用带有JDO的Maven GAE插件,我开始使用jappstart示例(https://github.com/tleese22/google-app-engine-jappstart/blob/master/pom.xml),但由于某种原因当我运行gae:run命令时,类没有增强,即使我已经配置了增强功能。

<plugin>
    <groupId>org.datanucleus</groupId>
    <artifactId>maven-datanucleus-plugin</artifactId>
    <version>1.1.4</version>
    <configuration>
        <mappingIncludes>**/jdo/*.class</mappingIncludes>
        <verbose>true</verbose>
        <enhancerName>ASM</enhancerName>
        <api>JDO</api>
    </configuration>
    <executions>
        <execution>                     
            <phase>compile</phase>                      
            <goals>
                <goal>enhance</goal>
            </goals>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-core</artifactId>
            <version>${datanucleus.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.transaction</groupId>
                    <artifactId>transaction-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-rdbms</artifactId>
            <version>${datanucleus.version}</version>
        </dependency>
        <dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-enhancer</artifactId>
            <version>1.1.4</version>
        </dependency>
        <dependency>
            <groupId>javax.jdo</groupId>
            <artifactId>jdo2-api</artifactId>
            <version>2.3-ec</version>
        </dependency>
    </dependencies>
</plugin>

例外:

javax.jdo.JDOUserException: Persistent class "Class com.my.Entity does not seem to have been enhanced.  You may want to rerun the enhancer and check for errors in the output." has no table in the database, but the operation requires it. Please check the specification of the MetaData for this class.

1 个答案:

答案 0 :(得分:0)

我的映射包含了一些问题。现在,如果实体位于具有姓氏实体的包中(例如com.my.app.entity),则它可以工作:

<mappingIncludes>**/entity/*.class</mappingIncludes>