简体   繁体   中英

Integrate GitHub Libraries with IntelliJ IDEA

I would like to integrate GitHub Scala Libraries with IntelliJ IDEA. Please guide me how to integrate libraries with this jetbrain IDE.

If you can come up with an sbt build file for your project that includes those libraries, all you have to do is open the project in IntelliJ IDEA - File > Open and select the directory in which the build.sbt file resides, then you will be offered to import a project from the existing sbt build file .

Your minimal project directory will be

project/build.properties

sbt.version=0.13.9

src/main/scala/mypackage

Directory where your source code goes

build.sbt

scalaVersion := "2.11.7"

// example library from Maven Central
libraryDependencies += "org.scala-lang.modules" % "scala-swing_2.11" % "1.0.2"

Or, for source repository that is not published :

build.sbt

lazy val root = Project("root", file("."))
  .dependsOn(libOnGitHub)
  .settings(
    scalaVersion := "2.11.7"
  )

// example project on GitHub
lazy val libOnGitHub = 
  ProjectRef(uri("git://github.com/user/repo.git#branch"), "project-name")

(This requires that the project is built by sbt, too)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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