maven-datanucleus-plugin:增强功能找不到文件

时间:2012-03-05 13:05:57

标签: google-app-engine maven datanucleus

我对maven-datanucleus-plugin有一个奇怪的问题。我已经读过与GAE一起使用的版本是1.1.4但是当我使用它时,插件找不到任何要增强的文件。这是我朋友的片段:

<plugin>
  <groupId>org.datanucleus</groupId>
    <artifactId>maven-datanucleus-plugin</artifactId>
    <version>1.1.4</version>
      <configuration>
        <persistenceUnitName>myUnit</persistenceUnitName>
        <api>JPA</api>
        <verbose>true</verbose>
        <enhancerName>ASM</enhancerName>
      </configuration>
      <executions>
        <execution>
          <phase>compile</phase>
          <goals>
            <goal>enhance</goal>
          </goals>
        </execution>
      </executions>
    </plugin>

当我将版本更改为3.0.1时,添加datanucleus-api-jpa 3.0.7并从net.kindleit.gae-runtime 1.6.3中排除datanucleus-core文件得到增强,问题是3.0.1与我理解的GAE不兼容,当我尝试运行应用程序时出现了一些错误。

为什么它适用于3.0.1但不适用于1.1.4?

1 个答案:

答案 0 :(得分:0)

尝试自定义实体路径:

  <plugin>
      <groupId>org.datanucleus</groupId>
        <artifactId>maven-datanucleus-plugin</artifactId>
        <version>1.1.4</version>
          <configuration>
            <persistenceUnitName>myUnit</persistenceUnitName>
            <api>JPA</api>
            <verbose>true</verbose>
            <enhancerName>ASM</enhancerName>
            <metadataIncludes>com/package/entities/*.class</metadataIncludes>
          </configuration>
          <executions>
            <execution>
              <phase>compile</phase>
              <goals>
                <goal>enhance</goal>
              </goals>
            </execution>
          </executions>
        </plugin>