简体   繁体   中英

Compile AppEngine project that has datastore callbacks with Ant

I've implemented datastore callbacks in our AppEngine project and set it up in Eclipse as indicated in the link.

Now I'm having trouble getting it to compile in Ant. Here's what I have for the javac target now:

<path id="appengine.api.path">
    <pathelement location="${appengine.folder}/lib/impl/appengine-api.jar" />
</path>

<target name="javac" depends="clean,libs" description="Compile java source">
    <mkdir dir="war/WEB-INF/classes" />
    <apt compile="false" preprocessdir=".apt_build_generated" destdir="war/WEB-INF/classes"
        srcdir="src"
        factorypathref="appengine.api.path"
        >
    </apt>
    <javac srcdir="src" includes="**" encoding="utf-8" destdir="war/WEB-INF/classes" source="1.6" target="1.6" nowarn="true" debug="true" debuglevel="lines,vars,source">
        <classpath refid="project.class.path" />
    </javac>
    <copy todir="war/WEB-INF/classes">
        <fileset dir="src" excludes="**/*.java" />
    </copy>

</target>

The apt task runs but all it does is list a bunch of annotations that don't have processor, including the PrePut annotation.

I've tried setting factorypathref to the ${appengine.folder}/lib/impl/appengine-api.jar but then it says the appengine-api.jar reference is not found (I've verified the path exists). I've also looked through the jar file to see if I can find the class it uses as the factory but haven't found it yet.

Finally discovered the problem. We were using the Eclipse compiler in our Ant build for other reasons. When we switched back to the built-in Java compiler, the annotation processor started working fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM