虽然ant clean在Liferay IDE中运行良好,但从命令行尝试时,我得到:
$ ant clean
Buildfile: /home/nico/myportlet/build.xml
[copy] Copying 1 file to /usr/share/ant/lib
Attempt to copy /home/nico/liferay-plugins-sdk-6.2-ee-sp14/lib/ecj.jar to /usr/share/ant/lib/ecj.jar using NIO Channels failed due to '/usr/share/ant/lib/ecj.jar (Permission denied)'. Falling back to streams.
BUILD FAILED
/home/nico/myportlet/build.xml:5: The following error occurred while executing this line:
/home/nico/liferay-plugins-sdk-6.2-ee-sp14/portlets/build-common-portlet.xml:5: The following error occurred while executing this line:
/home/nico/liferay-plugins-sdk-6.2-ee-sp14/build-common-plugin.xml:5: The following error occurred while executing this line:
/home/nico/liferay-plugins-sdk-6.2-ee-sp14/build-common.xml:94: Failed to copy /home/nico/liferay-plugins-sdk-6.2-ee-sp14/lib/ecj.jar to /usr/share/ant/lib/ecj.jar due to java.io.FileNotFoundException /usr/share/ant/lib/ecj.jar (Permission denied)
Total time: 2 seconds如何解决这个问题?
发布于 2016-02-08 11:12:25
只需以root用户身份手动复制文件即可。
这样做之后,ant将会很高兴,并且可以毫无抱怨地执行任务。
以下是如何在Linux/Mac上执行此操作:
sudo cp /home/nico/liferay-plugins-sdk-6.2-ee-sp14/lib/ecj.jar /usr/share/ant/lib/发布于 2017-08-14 14:44:47
或者为了不弄乱系统库,我们可以像这样引用文件夹到ant:
ant clean -lib /home/nico/liferay-plugins-sdk-6.2-ee-sp14/libhttps://stackoverflow.com/questions/35261846
复制相似问题