Intellij Idea中SBT依赖的问题 [英] Problems with SBT dependencies in Intellij Idea

查看:467
本文介绍了Intellij Idea中SBT依赖的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个让我紧张的问题。我正在为


This is a problem that is really getting on my nerves. I'm writing proofs for the Welder proof assistant. I was doing so without the help of an IDE and following an SBT-based building approach. This is the build file:

name := "proofs"
scalaVersion := "2.11.8"
lazy val welder = RootProject(uri("git://github.com/epfl-lara/welder.git#2b9dd10a7a751777cc9cda543ce888294113c0b1"))
lazy val root = (project in file(".")).dependsOn(welder)

I tried to bring my project into an Intellij Idea project. However, while doing so, the IDE won't recognize the imports of the external library:

import inox._

How can I solve this issue?

Edit

I stress that the compile errors are produced in the files from Welder

Here is the welder project/Build.scala file

import sbt._

object WelderBuild extends Build {

  lazy val root = Project("root", file(".")) dependsOn(inoxProject)
  lazy val inoxProject = RootProject(uri("git://github.com/epfl-lara/inox.git#53ea4533a957050bd6a968d5a340890bd54998a5"))

}

解决方案

See my answer to your other question and the issue on the Scala plugin issue tracker.

Renaming the modules and manually adding a dependency from the welder-root to the inox-root module will solve the compile path issue, but the build will still fail because one of the project uses source generators, which are not supported in IDEA directly.

Instead, enable the "use sbt for build and import" option in the sbt preferences:

这篇关于Intellij Idea中SBT依赖的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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