Configure Eclipse to pre-bundle App Engine classes into a single JAR for faster warm-up

后端 未结 7 1512
青春惊慌失措
青春惊慌失措 2021-02-02 12:15

After some discussion with a colleague from another company that also uses App Engine, he told me that he managed to cut down his app warm up time from ~15 seconds to ~5 seconds

7条回答
  •  囚心锁ツ
    2021-02-02 12:24

    What we did in Eclipse was:

    • In Project Properties > Java Build Path (Source tab) change output folder from war/WEB-INF/classes to something else, e.g. bin (I believe Eclipse complained about this once)
    • In Project Properties > Builders add a new builder (I used type "program builder" and pointed it to the jar executable in my JDK, but as others mentioned an Ant builder would work too). Obviously you should configure this builder to take its input from wherever you decided to write your class files to, and output to something like war/WEB-INF/lib/myclasses.jar

    You can configure the jar builder to execute automatically as class files change (which in turn are usually automatically recompiled as your source files change).

    There are some downsides, though. For some reason the google eclipse plugin gets confused by your changing the output directory of the java compiler. This means you will have to manually point to the war directory when deploying, and I believe you'll have to manually copy some GAE jars into the war/WEB-INF/lib folder.

提交回复
热议问题