Home  >  Q&A  >  body text

java - play framework 如何修改sbt存放jar包的仓库?

windows下默认存放在c盘用户目录下,产生.sbt和.ivy文件夹。

根据网上的一些介绍和自己的摸索,在c盘的.activator文件夹下面创建一个activatorconfig.txt文件,文件内容为:

-Dfile.encoding=UTF-8
-Dsbt.boot.directory=E:/activator/.sbt/boot
-Dsbt.ivy.home=E:/activator/repository
-py-home=E:/activator/repository
-Dactivator.local.repository=E:/activator/repository
-Dactivator.home=E:/activator
-Duser.home=E:/activator

此时点activator.bat的时候文件目录正确,但是在使用intellij idea 14的时候,选择sbt导入project,Global SBT settings-->launcher-->Custom选择activator.bat或者activator-launcher.jar并不管用,再次在c盘用户目录下面产生.sbt和.ivy文件夹。

这个问题是否有人遇到呢,如何解决呢

天蓬老师天蓬老师2715 days ago300

reply all(1)I'll reply

  • 迷茫

    迷茫2017-04-17 14:02:33

    Solved it myself

    First, use the command line to create a project, you can directly set activatorconfig.txt;

    Second, when using intellij idea14 version, choose sbt import and try to use the new version (the scala plug-in will also be updated). There are bugs in the old version
    You can specify it by creating the %SBT_OPTS% environment variable
    -Dsbt.global.base=E :activator.sbt
    -Dsbt.ivy.home=E:activator.ivy2
    -Dsbt.boot.directory=E:activator.sbtboot
    or specify custom sbt-launcher.jar to add vm parameters (same as above ); If you don’t plan to change the version, see the solution in point 3;

    Third, even the new version of Scala plug-in 1.5.2 still has this bug when compiling the project (.sbt and .ivy2 are created in the user directory of the c drive, please correct me if I am wrong). At this time, it seems that the only way is to directly Modify the sbt-launcher.jar that comes with the scala plug-in, and modify the corresponding file.IntelliJIdea14configpluginsScalalaunchersbt-launch.jarsbtsbt.boot.properties
    [boot]
    directory: E:/activator/.sbt/boot
    [ivy ]
    ivy-home: E:/activator/.ivy2

    reply
    0
  • Cancelreply