IntelliJ for unmanaged sbt dependencies

I had some co-worker having issues with using unmanaged dependencies within a Play Project. Here are the step we followed to make it work with IntelliJ.

  • Add your unmanaged dependency to your Play project
    • Add it to the default {{root}}/lib folder
      unmanagedBase in Compile := baseDirectory.value / "lib" / "main"
      
      
    • To add single custom folder
      unmanagedJars in Compile ++= {
      val base = baseDirectory.value
      val baseDirectories = (base / "libA") +++ (base / "b" / "lib") +++ (base / "libC")
      val customJars = (baseDirectories ** "*.jar") +++ (base / "d" / "my.jar")
      customJars.classpath
      }
      
    • To add Multiple folders
      unmanagedJars in Compile ++= {
      val base = baseDirectory.value
      val baseDirectories = (base / "libA") +++ (base / "b" / "lib") +++ (base / "libC")
      val customJars = (baseDirectories ** "*.jar") +++ (base / "d" / "my.jar")
      customJars.classpath
      }
      
lcamilo15
0

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: