问题描述
b
我的项目配置 pom.xml
非常简单:
在属性部分我配置:
In the properties section I configure:
<gae.version>1.7.4</gae.version>
后来我使用插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${gae.version}</version>
</plugin>
错误信息
每当我运行 mvn appengine:update
出现以下错误:
Error message
Whenever I run mvn appengine:update
I get the following error:
我试图解决它
当然,我试图解决这个问题。运行
My attempt to solve it
Of course, I tried to fix this issue. Running
mvn appengine:update --use_java7
或
mvn appengine:update -D--use_java7
没有帮助,因为该标记不用于Maven插件,而是用于 appcfg
脚本。
didn't help, because the flag is not used for the Maven plugin, but instead for the appcfg
script.
如何将标志传递给脚本,以便我可以使用Java 7否则我可以做到)?
推荐答案
App Engine Java 7支持目前用于可信测试人员,但是,您可以在应用受信任的测试人员。
App Engine Java 7 Support is currently for Trusted Tester and not available to public yet, you can apply Trusted Tester at here.
幸运的是,最新的官方maven插件确实实现了该功能,请参阅AbstractAppCfgMojo.java:
Fortunately the latest official maven plugin does implement this feature, see the AbstractAppCfgMojo.java:
... ...
/**
* Use the App Engine Java 7 runtime for this app.
*
* @parameter
*/
protected boolean useJava7;
... ...
if (useJava7) {
arguments.add("--use_java7");
}
... ...
您可以在pom.xml中使用以下插件配置来启用Java7支持:
You can use the following plugin configuration in pom.xml to enable Java7 support:
</build>
<plugins>
... ...
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${gae.version}</version>
<configuration>
<useJava7>true</useJava7>
</configuration>
</plugin>
</plugins>
</build>
这篇关于在官方的Google Appengine Maven插件中使用Java 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!