「操作は許可されていません」というエラー メッセージが表示されますか?
例
Ubuntu では、chown タスクは OS によって制限されています。
$ ant
build:
[chown] chown: changing ownership of `/home/mark/tmp/build/one/test.txt': Operation not permitted
[chown] chown: changing ownership of `/home/mark/tmp/build/three/test.txt': Operation not permitted
[chown] chown: changing ownership of `/home/mark/tmp/build/two/test.txt': Operation not permitted
[chown] chown: changing ownership of `/home/mark/tmp/build': Operation not permitted
[chown] chown: changing ownership of `/home/mark/tmp/build/one': Operation not permitted
[chown] chown: changing ownership of `/home/mark/tmp/build/three': Operation not permitted
[chown] chown: changing ownership of `/home/mark/tmp/build/two': Operation not permitted
[chown] Result: 1
[chown] Applied chown to 3 files and 4 directories.
「chown」コマンドを実行すると、同じ制限が示されます
$ chown -R an_other_user build
chown: changing ownership of `build/one/test.txt': Operation not permitted
chown: changing ownership of `build/one': Operation not permitted
chown: changing ownership of `build/two/test.txt': Operation not permitted
chown: changing ownership of `build/two': Operation not permitted
chown: changing ownership of `build': Operation not permitted
最善の解決策は、root ユーザーとして ANT を実行することです。
$ sudo ant
build.xml
<project name="demo" default="build">
<target name="init">
<mkdir dir="build/one"/>
<mkdir dir="build/two"/>
<echo file="build/one/test.txt" message="helloworld"/>
<echo file="build/two/test.txt" message="helloworld"/>
</target>
<target name="build" depends="init">
<chown owner="an_other_user" verbose="true">
<fileset dir="build"/>
<dirset dir="build"/>
</chown>
</target>
<target name="clean">
<delete dir="build"/>
</target>
</project>