Play2.7的开发环境搭建和本地sbt仓库配置

1、环境安装

JDK安装(省略)

sbt安装:安装sbt1.3.2 版本,Play2.7官方推荐的版本,下载sbt最新版的msi文件,设置自定义安装的路径,

是路径中不包含空格和中问符号;

下载官方的 play-samples-play-java-hello-world-tutorial.zip 案例,解压缩后,通过终端进入解压目录

输入 sbt sbtVersion查看版本信息,显示类似下图,则表明安装成功。

2.sbt本地仓库的配置

都是泪。。。。。。。。好不容易才尝试出来的最终版本!仅供参考!!!

1)在主机 C:\Users\40275\ 中的.sbt目录下,新建repositories文件,将下面内容拷贝进去

[repositories]
  local
  aliyun: https://maven.aliyun.com/nexus/content/groups/public/
  #central: http://repo1.maven.org/maven2/
  my-ivy-proxy-releases: https://repo.company.com/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  my-maven-proxy-releases: https://repo.company.com/maven-releases/
  sonatype-oss-releases

2)然后在sbt的安装目录下的conf下,在配置文件中sbtconfig.txt尾部添加下述内容:

#add sbt configuration
-Dsbt.global.base=C:/Users/40275/.sbt
-Dsbt.repository.config=C:/Users/40275/.sbt/properties

我本地的内容,供参考:

# sbt configuration file for Windows

# Set the java args

-Xms1024m
-Xmx1024m
-Xss4M
-XX:ReservedCodeCacheSize=128m

# Set the extra sbt options

# -Dsbt.log.format=true
-Dfile.encoding=UTF8
#add sbt configuration
-Dsbt.global.base=C:/Users/40275/.sbt
-Dsbt.repository.config=C:/Users/40275/.sbt/properties
# backup
# -Dsbt.repository.config=C:/Users/40275/.sbt/properties

都配置好以后进入项目目录中,输入sbt run,运行项目,开始拉取远端仓库到本地,默认的仓库包下载到本地用户下.ivy2目录下

过程可能及其漫长,这时候你可以出去打会球,回来以后再接着弄!!!

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值