Scala/SBT project fails to import library

When creating a new project using Scala/SBT with a specific Maven Central repository library, SBT fails to import the library to the "External Libraries".

To reproduce the problem:

1 - Create a new Scala/SBT project.

2 - copy these lines to the "build.sbt" file:

name := "Test"

version := "0.1"

scalaVersion := "2.12.4"

libraryDependencies += "org.jgrapht" % "jgrapht" % "1.1.0"

(the line suggested in Maven repo also fails the same way:)

libraryDependencies += "org.jgrapht" % "jgrapht" % "1.1.0" pomOnly()


3 - Import or Refresh SBT (either "import project" or in the "sbt project" window, click the "refresh all sbt projects"

The "Build" window will run for a few moments and show a message "Test:synced successfully"

BUT, the library (.jar) is NOT imported. It's not listed in the External Libraries of the Project and does not work.

A workaround is to go to the "Project Structure"/Libraries and import the library manually.

Any other library that I've tested worked normally.

Is this a bug?

Thanks.

Marcos

 

 

 

0
5 comments

Does it work correctly in the terminal, outside of IntelliJ IDEA? Any errors in idea.log?

0

Hello Serge,

Thanks for answering.

There is no messages in the Event Log. Is this the same idea.log you mentioned?

I don't know if it works outside of IntelliJ Idea. How can I test this?

 

0

There are some related INFOs in idea.log. I'm checking SBT outside of Idea.

 

2018-01-03 17:41:39,517 [ 13719] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: C:/Program Files/JetBrains/IntelliJ IDEA 2017.3.1/lib/jps-launcher.jar;C:/Program Files/Java/jdk1.8.0_111/lib/tools.jar;C:/Program Files/JetBrains/IntelliJ IDEA 2017.3.1/lib/optimizedFileManager.jar
2018-01-03 17:41:39,555 [ 13757] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
2018-01-03 17:41:39,555 [ 13757] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Defaulting to no-operation (NOP) logger implementation
2018-01-03 17:41:39,555 [ 13757] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

 

 

 

0

It seems "org.jgrapht" % "jgrapht" % "1.1.0" only contains metadata, so no actual library is added to the project on import. The jgrapht github page suggests importing jgrapht-core instead:

libraryDependencies += "org.jgrapht" % "jgrapht-core" % "1.1.0"

 

0

Please sign in to leave a comment.