A Java hello-world application on Google App Engine (part 2)
2010-11-25 14:25
Write commentBefore you start reading this article I recommend that you take a look at the previous part, so you can understand this one better.
Anyway what we gonna see today is some configuration, to help Ant compiling our helloworld GAE project and deploy it on GAE, you could see it in link and download the whole project i've covered during part 1 and part 2 of this simple tutorial.
First of all, a short notice for people who have tried GAE using Python:
Java is a compiled programming language so you need to compile your source code in favor to use it, but in our case we gonna need a tool to automate building our project, like Apache Ant or just let’s just call it Ant.
Back on track, let me first tell you that Ant will look for a file named build.xml by default.
After that, it’ll do exactly what it was told to do, so let’s edit that helloworld/build.xml file to make things work:
<project>
<property name="sdk.dir" location="../" />
<import file="${sdk.dir}/config/user/ant-macros.xml" />
<path id="project.classpath">
<pathelement path="war/WEB-INF/classes" />
<fileset dir="war/WEB-INF/lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="${sdk.dir}/lib">
<include name="shared/**/*.jar" />
</fileset>
</path>
</project>watch out from this line <property name="sdk.dir" location="Path/To/Your/GAE/SDK" />
to be more safe and less confused while debugging just put the absolute path instead of relative.
Next we gonna need the ant macro, that comes with the SDK, and what in it exactly is a bunch of functions-declaration-like, that we gonna need later.




