0
votes

I have a strange problem with maven-datanucleus-plugin. I have read that the version that works with GAE is 1.1.4 but when I use it the plugin does not find any files to enhance. This is a snippet from my pom:

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

When I change the version to 3.0.1, adds datanucleus-api-jpa 3.0.7 and excludes datanucleus-core from net.kindleit.gae-runtime 1.6.3 the files gets enhanced, the problem is that 3.0.1 is not compatible with GAE as I understand and I get some errors when I try to run the app.

Why does it work with 3.0.1 but not 1.1.4?

1
DN M2 plugin v1.1 works with GAE plugin v1. DN M2 plugin v3.0 works with GAE plugin v2. Looking in the log would obviously reveal things, since it prints out the classpath being used for enhancement (as well as much more) - DataNucleus
I am a bit lost here. Where can I find the log? - Alex
You get the log by looking at the docs and defining a log4j.properties file (or jdk14 log config file) datanucleus.org/products/accessplatform_3_0/… - DataNucleus
Also see this code.google.com/p/datanucleus-appengine/wiki/… which explains how you can use a later version of the GAE plugin (v2) that works with DataNucleus v3.x - DataNucleus

1 Answers

0
votes

Try custom defining the entity path:

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