IntelliJ IDEA 13:新的Scala SBT项目尚未生成src目录结构 [英] IntelliJ IDEA 13: new Scala SBT project hasn't src directory structure generated

查看:190
本文介绍了IntelliJ IDEA 13:新的Scala SBT项目尚未生成src目录结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Jetbrains网站上观看了入门视频,以设置IntelliJ IDEA 13.1 Community Edition与Scala一起使用.已安装Scala插件v0.36.431.当我使用向导创建了一个新的Scala SBT项目时,该项目中没有生成src/目录结构.仅生成了两个sbt文件:

I followed the getting start video on Jetbrains website to setup IntelliJ IDEA 13.1 Community Edition to work with Scala. Scala plugin v0.36.431 had been installed. While I created a new Scala SBT project with wizard, there was no src/ directory structure generated in the project. Only two sbt files were generated:

scala-course/
├── build.sbt
└── project
    └── plugins.sbt

从视频和其他文档中,我知道应该有一个src/目录结构,包括src/main/scalasrc/test/scala等.默认情况下,sbt使用与Maven相同的目录结构来处理源文件.

From the video and other document I know that there should be a src/ directory structure, including src/main/scala, src/test/scala, etc. sbt uses the same directory structure as Maven for source files by default.

我可以手动创建这些文件夹并将其标记为源根目录.但是,这是微不足道的.所以我的问题是:为什么IntelliJ IDEA新项目向导没有生成文档中所述的目录结构?我做错什么了吗?我检查了首选项,找不到任何似乎相关的内容.

I can create those folders manually and mark it as source root. However it is trivial. So my question is: Why IntelliJ IDEA new project wizard doesn't generate the directory structure as said in document? Was I doing something wrong? I checked the preferences and couldn't find anything that seems related.

推荐答案

感谢lpiepiora,他的提示找出原因.

Thanks to lpiepiora, with his hint I find out the reason.

因为我的sbt是新安装的,所以~/.ivy2/cache/~/.sbt/boot/中没有任何内容.需要从网络存储库下载所需依赖项的sbt.碰巧我的互联网代理出现问题,下载卡住了.

Because my sbt is newly installed, there is nothing in ~/.ivy2/cache/ and ~/.sbt/boot/. sbt needed to download required dependencies from repositories on network. It happened that my proxy to internet had something wrong, download stuck.

并且还需要注意的是,如果当sbt在后台运行时退出IntelliJ IDEA,那么下次您将收到等待一些锁定文件的错误消息.必须删除文件系统上的锁定文件,然后重新启动IntelliJ IDEA.

And also need to notice that, if quit IntelliJ IDEA when sbt is running in background, the next time you'll get error of waiting for some lock file. Have to remove the lock file on filesystem and restart IntelliJ IDEA again.

解决网络问题后,一切都会按承诺进行.下载所需的jar文件需要几分钟,具体取决于网络速度.完成后,将创建src/目录结构.

After fixed the network problem, everything work as promised. It requires several minutes, depends on network speed, to download required jar files. After finished, the src/ directory structure is created.

这篇关于IntelliJ IDEA 13:新的Scala SBT项目尚未生成src目录结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆