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目录下
过程可能及其漫长,这时候你可以出去打会球,回来以后再接着弄!!!