0

I have read that JARing up Java classes before uploading them to App Engine improves performance. Can anyone explain how that is done? Can that be achieved from within Eclipse?

4

3 回答 3

1

您可以轻松使用 Ant 制作 jar

<property name="staging.dir" value="war"/>
<property name="classes.dir" value="${staging.dir}/WEB-INF/classes"/>

<target name="jarClasses">
    <delete file="${staging.dir}/WEB-INF/lib/classes.jar" />
    <echo> ${staging.dir}/WEB-INF/lib/classes.jar DELETED </echo>
    <jar destfile="${staging.dir}/WEB-INF/lib/classes.jar" basedir="${classes.dir}" />
    <echo> ${staging.dir}/WEB-INF/lib/classes.jar JARRED </echo>
    <delete dir="${classes.dir}" />
    <echo> ${classes.dir} DELETED </echo>
</target>

我的布局是这样的:

/war
/build.xml

或者,您可以使用 Ant 任务进行部署

配置 Eclipse 以将 App Engine 类预捆绑到单个 JAR 中以加快预热

我没有这样做,因为我不确定如何处理密码验证。

于 2012-07-29T02:25:22.840 回答
0

Take a look at Google Plugin for Eclipse.

It assembles all components required to build WAR files. Deployment must be done manually though.

于 2012-07-29T00:16:12.743 回答
0

我不确定这是否是您在谈论的内容,但是您可以通过右键单击项目,然后选择导出 -> Java -> Jar 文件来从 Eclipse 项目中创建一个 JAR。一定要选择入门类/主类,不然不行!

于 2012-08-04T22:20:31.927 回答