Я пытаюсь скомпилировать проект GWT + App Engine + JDO + Datanucleus с Maven.
Когда maven начинает компилировать исходники Java, я получаю сообщение об ошибке:
[DEBUG] Source roots:
[DEBUG] /home/desarrollo26/eclipse-workspace/projectName/src
[DEBUG] /home/desarrollo26/eclipse-workspace/projectName/target/generated-sources/annotations
[DEBUG] Command line options:
[DEBUG] -d /home/desarrollo26/eclipse-workspace/projectName/target/projectName-1.0-SNAPSHOT/WEB-INF/classes -classpath (all .m2 dependencies)
[DEBUG] incrementalBuildHelper#beforeRebuildExecution
[INFO] Compiling 644 source files to /home/desarrollo26/eclipse-workspace/projectName/target/projectName-1.0-SNAPSHOT/WEB-INF/classes
DataNucleus : JDOQLTypedQuery Q class generation : com.projectName.server.extension.TokenExtension -> com.projectName.server.extension.QTokenExtension
Я следовал за всеми процессами datanucleus-maven, JDO и Enhanced со страницы документации Datanucleus, а JDO и JDO Query присутствуют в CLASSPATH, но постоянная ошибка:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.814 s (Wall Clock)
[INFO] Finished at: 2018-09-17T13:00:24+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project Nubbius: Fatal error compiling: java.lang.NoClassDefFoundError: javax/jdo/query/PersistableExpression: javax.jdo.query.PersistableExpression
На самом деле, мои зависимости для JDO / JPA, Datanucleus:
<!-- https://mvnrepository.com/artifact/javax.persistence/persistence-api -->
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.appengine.orm</groupId>
<artifactId>datanucleus-appengine</artifactId>
<scope>runtime</scope>
<version>2.1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.datanucleus/datanucleus-jdo-query -->
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-jdo-query</artifactId>
<version>(3.9, )</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.ow2.asm/asm -->
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>5.0.3</version>
</dependency>
Плагин для авто-энхансера Datanucleus:
<plugin>
<groupId>org.datanucleus</groupId>
<artifactId>maven-datanucleus-plugin</artifactId>
<version>3.2.0-m1</version>
<configuration>
<api>JDO</api>
<props>${basedir}/datanucleus.properties</props>
<log4jConfiguration>${project.basedir}/src/log4j.properties</log4jConfiguration>
<enhancerName>ASM</enhancerName>
<verbose>true</verbose>
<fork>false</fork>
<metadataIncludes>**/*.jdo</metadataIncludes>
<metadataIncludes>**/*.class</metadataIncludes>
</configuration>
<dependencies>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
<version>3.1.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jdo</artifactId>
<version>3.1.3</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jpa</artifactId>
<version>3.1.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.datanucleus/datanucleus-enhancer -->
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-enhancer</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.8.2</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
А вот процесс сборки GWT:
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-8</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<moduleName>com.projectName.Administracion</moduleName>
<moduleName>com.projectName.Cronometro</moduleName>
<moduleName>com.projectName.Extension</moduleName>
<moduleName>com.projectName.projectName</moduleName>
<failOnError>true</failOnError>
<!-- GWT compiler 2.8 requires 1.8, hence define sourceLevel here if you use
a different source language for java compilation -->
<sourceLevel>1.8</sourceLevel>
<!-- Compiler configuration -->
<compilerArgs>
<!-- https://tbroyer.github.io/gwt-maven-plugin/compile-mojo.html -->
<!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
<arg>-compileReport</arg>
<arg>-XcompilerMetrics</arg>
<arg>-Xms1024M</arg>
<arg>-Xmx2014M</arg>
</compilerArgs>
<style>DETAILED</style>
<draftCompile>TRUE</draftCompile>
<localWorkers>6</localWorkers>
<!-- CodeserverMode configuration (for debugging in SuperDevMode -->
<!-- https://tbroyer.github.io/gwt-maven-plugin/codeserver-mojo.html -->
<codeServerPort>9997</codeServerPort>
<jvmArgs>
<arg>-Xms1024M</arg>
<arg>-Xmx2014M</arg>
<arg>-javaagent:localDependenciesPath/appengine-java-sdk-1.9.59/lib/agent/appengine-agent.jar </arg>
</jvmArgs>
<classpathScope>runtime</classpathScope>
<!-- URL(s) that should be opened by DevMode (gwt:devmode). -->
<startupUrls>
<startupUrl>projectName.jsp</startupUrl>
</startupUrls>
</configuration>
</plugin>
<!-- Compilador -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
Кто-нибудь знает, что может вызвать эту ошибку? Спасибо!