简体   繁体   English

IntelliJ“SBT项目导入”,创建两个模块

[英]IntelliJ “SBT project import” that creates two modules

I have a Scala SBT project. 我有一个Scala SBT项目。 When I import the project with IntelliJ, I have two modules to select in the project. 当我使用IntelliJ导入项目时,我在项目中有两个模块可供选择。

在此输入图像描述

Why do I have additional "-build" project? 为什么我有额外的“-build”项目? Do I have to include the module, or is it OK to ignore the module? 我是否必须包含该模块,还是可以忽略该模块?

According to the doc : 根据文件

In addition to ordinary modules (which correspond to SBT “projects”), IDEA creates special “SBT” modules, which describe SBT build definitions themselves (.sbt files and Scala files in project directories) in order to provide highlighting, auto-completion and navigation for these files and SBT libraries. 除了普通模块(对应于SBT“项目”)之外,IDEA还创建了特殊的“SBT”模块,它们描述了SBT构建定义本身(.sbt文件和项目目录中的Scala文件),以提供突出显示,自动完成和导航这些文件和SBT库。

To have the full functionality you should include the module. 要拥有完整功能,您应该包含该模块。 In the *build.iml files information about the dependencies are stored (amongst other things). 在* build.iml文件中存储有关依赖项的信息(以及其他内容)。

Without the module, the build.sbt shows errors in parsing sbt files. 如果没有该模块,build.sbt会在解析sbt文件时显示错误。

在此输入图像描述

It's also easy to turn on/off from "SBT projects". 从“SBT项目”开启/关闭也很容易。

在此输入图像描述

This is after adding the build module. 这是在添加构建模块之后。

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM