2011-08-28 77 views
1

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

<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. 

回答

0

我有什么毛病我的映射包括。现在,如果实体处于具有姓氏实体的包中(例如com.my.app.entity),它就可以工作:

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