我正在服务器上部署一个Play应用程序,但在~/目录下没有写入权限。当我运行play deps命令时,出现以下错误:
[playdemo-playdemo.rhcloud.com repo]\> ~/playdemo/data/play-1.2.4/play deps
~ _ _
~ _ __ | | __ _ _ _| |
~ | '_ \| |/ _' | || |_|
~ | __/|_|\____|\__ (_)
~ |_| |__/
~
~ play! 1.2.4, http://www.playframework.org
~
~ Resolving dependencies using /var/lib/libra/eadfb84dc0ac4b05baa584693f557e5e/playdemo/runtime/repo/conf/dependencies.yml,
~
Exception in thread "main" java.io.FileNotFoundException: /var/lib/libra/eadfb84dc0ac4b05baa584693f557e5e/.ivy2/cache/resolved-play-application-repo-1.0.xml (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:209)
at java.io.FileOutputStream.<init>(FileOutputStream.java:160)
at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriter.write(XmlModuleDescriptorWriter.java:69)
at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriter.write(XmlModuleDescriptorWriter.java:61)
at org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor.toIvyFile(DefaultModuleDescriptor.java:549)
at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:248)
at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:195)
at play.deps.DependenciesManager.resolve(DependenciesManager.java:327)
at play.deps.DependenciesManager.main(DependenciesManager.java:39)
我尝试了几种方法来更改缓存目录,比如在app.conf中创建一个ivysettings.xml文件并添加以下内容:
<ivysettings>
<caches defaultCacheDir="/tmp/ivy"/>
</ivysettings>
传递一个 -D-cache=/tmp/ivy 参数
设置 JAVA_OPTS 环境变量
export JAVA_OPTS="$JAVA_OPTS -Divy.default.ivy.user.dir=/tmp/ivy"
将其作为参数传递
play deps -Divy.default.ivy.user.dir=/tmp/ivy
但是似乎什么都不起作用……
你有什么想法吗???
问候
sas
--
编辑
PS:找到了这个相关问题:如何覆盖Ivy缓存的位置?