I’m using ant to build a project in eclipse. Before the jar is constructed, I want to move some files from another project into a resources folder in this project.
The problem I’m having is that none of the files show up in the jar.
Example:
<project>
<target name="A">
<copy file="../otherloc/file1" tofile="resources/file1" />
<waitfor><available file="resources/file1" /></waitfor>
</target>
<target name="B" depends="A">
<jar destfile="dist/jarfile.jar">
... (actually build the jar)
</jar>
</target>
</project>
So in the above case, “file1” doesn’t actually make it into the jar, even though everything else in the resources directory does. Eclipse doesn’t show the new file in the resources directory until I refresh, either. It’s like, because eclipse doesn’t know about it, it’s not included in the build.
Any suggestions appreciated. I’m pretty much an Ant noob, so it’s possible I’m going about this entirely wrong.
Edit: Alternately, is there some way to just include the file from the other project? I was a little unclear on the best way to get it into the jar. It needs to be in a directory along with some other existing project files.
Unfortunately we haven’t been able to resolve this, so we just work around it by separating the task into two steps and copying the files before running the build script. Not really a great “answer”, but nothing else has been suggested.