• sbt 学习笔记(1)sbt安装和交互式界面使用


    下载sbt:

    http://www.scala-sbt.org/download.html

     

    解压zip文件F:sbt-0.13.15

    配置环境变量

    如果需要可以修改F:sbt-0.13.15sbtconfsbtconfig.txt

    #ivy的cache等,保存到指定的文件夹;不配置的话sbt下载的jar包都会默认放到C盘的用户目录下

    #-Dsbt.boot.directory=F:/sbt-0.13.15/sbt/boot

    #The directory defined here is used to store all cached JARs resolved launcher.

    #-Dsbt.ivy.home=F:/sbt-0.13.15/sbt/.ivy2

    #-Dsbt.override.build.repos=true
    #-Dsbt.global.base=F:/sbt-0.13.15/sbt/.sbt

    #代理设置

    #-Dhttp.proxyHost=xxx.xxx.com  

    #-Dhttp.proxyPort=xx

    #-Dsbt.repository.config=F:/sbt-0.13.15/sbt/conf/repo.properties

    建立repo.properties,添加阿里云

    [repositories]
    
    local
    
    nexus-aliyun:http://maven.aliyun.com/nexus/content/groups/public
    
    nexus-aliyun-ivy:http://maven.aliyun.com/nexus/content/groups/public/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
    
    typesafe: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly

    创建一个文件夹FirstSbtProject,构建以下目录

    修改build.sbt 内容

    name := "FirstSbtProject"

    version := "1.0" 

    scalaVersion := "2.10.6"

    进入到项目根目录,输入sbt回车进入sbt交互模式, 第一次运行会比较慢,耐心等待,要下载相关的jars

    输入help命令查询,即会列出一堆可用的命令

    输入show name,看当前项目的名字,输入show libraryDependencies看当前项目依赖的库,libraryDependencies太长记不住?输入lib后按tab键,可列出相关内容

    有一个强大的任务不得不特别拎出来说一下:console 
    输入console回车,会在当前会话内启动一个Scala REPL

  • 相关阅读:
    设计模式-单例模式
    Java对象声明时:new与null的区别
    Mysql的UseAffectedRows问题 以及其他常见配置说明
    将form表单元素的值序列化成对象
    idea教程视频以及常用插件整理
    Ajax获取Response头信息
    BootstrapTable返回结果集递增序号
    mybaitis动态sql利用bind标签代替%拼接完成模糊查询
    Numpy库使用
    基于socket实现websocket服务
  • 原文地址:https://www.cnblogs.com/AK47Sonic/p/7056475.html
Copyright © 2020-2023  润新知