我在Ubuntu上使用android studio并且一直在尝试设置Google App Engine后端。这是我的pom.xml文件,我试图使用所有依赖项和插件的最新版本。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.watch.project</groupId>
<artifactId>watch-AppEngine</artifactId>
<properties>
<appengine.target.version>1.8.9</appengine.target.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- Compile/runtime dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>${appengine.target.version}</version>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-endpoints</artifactId>
<version>${appengine.target.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0-alpha-1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jpa_2.0_spec</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>net.sf.jsr107cache</groupId>
<artifactId>jsr107cache</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
<version>3.2.11</version>
</dependency>
<dependency>
<groupId>com.google.appengine.orm</groupId>
<artifactId>datanucleus-appengine</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jpa</artifactId>
<version>3.3.6</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.ganyo</groupId>
<artifactId>gcm-server</artifactId>
<version>1.0.2</version>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-testing</artifactId>
<version>${appengine.target.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId>
<version>${appengine.target.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- for hot reload of the web application-->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes
</outputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<version>3.1</version>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<webXml>
${project.build.directory}/generated-sources/appengine-endpoints/WEB-INF/web.xml
</webXml>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>
${project.build.directory}/generated-sources/appengine-endpoints
</directory>
<!-- the list has a default value of ** -->
<includes>
<include>WEB-INF/*.discovery</include>
<include>WEB-INF/*.api</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.8.9</version>
<configuration>
<enableJarClasses>false</enableJarClasses>
</configuration>
<executions>
<execution>
<goals>
<goal>endpoints_get_discovery_doc</goal>
<!--goal>endpoints_get_client_lib</goal-->
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Java版本: dexter @ dexter-Lenovo-G505s:〜$ java -version java版“1.8.0-ea” Java(TM)SE运行时环境(版本1.8.0-ea-b108) Java HotSpot(TM)64位服务器VM(内置25.0-b50,混合模式)
Maven版本: Apache Maven 3.1.1(0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 20:52:22 + 0530) Maven home:/home/dexter/Desktop/apache-maven-3.1.1 Java版本:1.8.0-ea,供应商:Oracle Corporation Java home:/usr/local/java/jdk1.8.0/jre 默认语言环境:en_IN,平台编码:UTF-8 操作系统名称:“linux”,版本:“3.8.13-992-generic”,arch:“amd64”,family:“unix”
当我尝试执行mvn编译时,出现以下错误:
[ERROR] -------------------- [ERROR]来自的标准错误 DataNucleus工具+ org.datanucleus.enhancer.DataNucleusEnhancer: [ERROR] -------------------- [ERROR]线程“main”中的异常 java.lang.IllegalArgumentException异常 在org.datanucleus.asm.ClassReader。(ClassReader.java:185) 在org.datanucleus.asm.ClassReader。(ClassReader.java:168) 在org.datanucleus.asm.ClassReader。(ClassReader.java:439) at org.datanucleus.enhancer.jdo.JDOClassEnhancer.getClassNameForFileName(JDOClassEnhancer.java:172) at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:730) 在org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:513) 在org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1281)
以下是错误的完整堆栈跟踪的链接: http://pastebin.com/bAeMZyeb
请帮我解决这个问题,谢谢你的耐心等待。
答案 0 :(得分:-1)
这已经解决了。
当构建过于最新并且源位置发生某些更改时,会出现此类问题。 10分钟后再次尝试为我解决了这个问题,使用最新的appengine.target.version构建成功。