Skip to content
This repository

Add setting to always use absolute paths for library dependencies #79

Closed
jorgeortiz85 opened this Issue January 10, 2012 · 6 comments

3 participants

Jorge Ortiz Heiko Seeberger Niels
Jorge Ortiz

I have a somewhat complicated sbt setup:

My eclipse workspace is ~/Code
My sbt base directory is ~/Code/foursquare/web
That has several sub projects in ~/Code/foursquare/web/batch, ~/Code/foursquare/web/core, etc
My binary dependencies are fetched to ~/Code/foursquare/web/lib_managed

My generated .classpath files (e.g., ~/Code/foursquare/web/batch/.classpath) have entries that look like:

<classpathentry path="../lib_managed/jars/junit-3.8.1.jar" kind="lib"></classpathentry>

The path is correct, but Eclipse doesn't seem to like the ".." part. The jars are marked as not found in the Eclipse build path configuration. I've tried every combination imaginable (relative to the workspace directory, relative to the base directory, ./../, etc) and nothing other than absolute path seems to work.

Jorge Ortiz jorgeortiz85 referenced this issue from a commit in foursquare/sbteclipse January 10, 2012
Jorge Ortiz Always use absolute paths as work around for #79 b0847d2
Heiko Seeberger
Owner

Hi Jorge,

On the long run I could add a setting to use absolute paths. But could you please also try to use separate directories for the Eclipse workspace and the sbt projects? I can remember that there were several Eclipse issues back some day related to using the same directories.

Heiko

Jorge Ortiz

What do you mean? My workspace and sbt project are already separate directories. Or you mean not in the same path?

Heiko Seeberger
Owner

The latter.

Jorge Ortiz

No luck :(

Heiko Seeberger
Owner

I could reproduce the issue (indeed an Eclipse issue), but I could also resolve it by using a different workspace directory. So maybe you should once again try your luck, at least try it with my setup. It will fail, if you create your workspace in the below ws, but if you create it in a directory which is not a super directory of this ws, it should work.

/Users/heiko/tmp/ws workspace directory
/Users/heiko/tmp/ws/test build (root project) directory
/Users/heiko/tmp/ws/test/suba subproject directory
/Users/heiko/tmp/ws/test/subb subproject directory

ws/test/project/Build.scala:

import sbt._
import sbt.Keys._

object Build extends Build {

  lazy val root = Project(
    "root",
    file("."),
    aggregate = Seq(suba, subb)
  )

  lazy val suba = Project(
    "suba",
    file("suba"),
    settings = Project.defaultSettings ++ Seq(
      libraryDependencies ++= Seq(
        "biz.aQute" % "bndlib" % "1.50.0"
      ),
      retrieveManaged := true
    )
  )

  lazy val subb = Project(
    "subb",
    file("subb"),
    dependencies = Seq(suba)
  )
}
Niels

I have similar problem with the snapshot-version. Now I choose github/myProjects github/ws/.metadata and it works.

Heiko Seeberger hseeberger closed this in c3aa1ea March 02, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.