(1)windows中安装任意版本的sbt
(2)配置两个文件
注意sbtconfig.txt中的参数,IDEA中配置需要使用
repository.properties | sbtconfig.txt |
[repositories] local huaweicloud-maven: https://repo.huaweicloud.com/repository/maven/ maven-central: https://repo1.maven.org/maven2/ sbt-plugin-repo: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] | # sbt configuration file for Windows # Set the java args #-mem 1024 was added in sbt.bat as default -Xms1024m # Set the extra sbt options # -Dsbt.log.format=true |
(3)全局设置
设置如下
(4)创建scala的sbt项目
注意
(5)IDEA 打包项目为jar包流程
新建工程名xinxin
新建scala对象名aa
打包完成会有目录out出现
首先File=>Project Structure=>Artifacts=>+=>JAR=>From module with dependencies
=>Module<All Modules>=>Main Class主类选aa即可=>ok=>ok
然后Build=>Build Artifacts=>Build