Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing or invalid dependency #41

Closed
sbuljat opened this issue Dec 7, 2015 · 6 comments
Closed

Missing or invalid dependency #41

sbuljat opened this issue Dec 7, 2015 · 6 comments
Labels

Comments

@sbuljat
Copy link

sbuljat commented Dec 7, 2015

If my published artifact has a dependency on MongoDB driver library then project which depends on my library cannot compile without explicit MongoDB library dependency in build.sbt. Shouldn't it retrieve as transitive dependency? Tried maven and ivy style...same

@laughedelic
Copy link
Contributor

Hi @sbuljat.
Can you show the build.sbt files of the project that depends on MongoDB and the the other one that depends on it? Also the version of sbt used and the error message could be useful.

@sbuljat
Copy link
Author

sbuljat commented Dec 7, 2015

Hi @laughedelic

Here's build.sbt from project 1:

name := "project-id"

organization  := "com.project"

version := "1.0.4"

publishTo := {
  val prefix = if (isSnapshot.value) "snapshots" else "releases"
  Some(s3resolver.value("Releases", s3("releases.project.com")) withMavenPatterns)
}

s3credentials := file(".s3credentials")

libraryDependencies ++= Seq(
    "org.scalatest" %% "scalatest" % "2.2.4"    % "test",
    "com.typesafe" % "config" % "1.3.0",
    "org.mongodb" %% "casbah" % "3.0.0"
)

Here's build.sbt from project 2:

name := "project-ner"

organization  := "com.project"

version := "1.0.1"

scalaVersion := "2.11.7"

s3credentials := file(".s3credentials")

resolvers ++= Seq[Resolver](
   s3resolver.value("Releases", s3("releases.project.com")).withMavenPatterns
)

libraryDependencies ++= Seq(
   "org.scalatest" %% "scalatest" % "2.2.4" % "test",
   "com.typesafe" %   "config" % "1.3.0",
   "com.project" %%  "project-id" % "1.0.4"
)

Error in project 2:

[error] missing or invalid dependency detected while loading class file 'Location.class'.
[error] Could not access term mongodb in package com,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with -Ylog-classpath to see the problematic classpath.)
[error] A full rebuild may help if 'Location.class' was compiled against an incompatible version of com.
[error] missing or invalid dependency detected while loading class file 'Location.class'.
[error] Could not access term casbah in value com.mongodb,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with -Ylog-classpath to see the problematic classpath.)
[error] A full rebuild may help if 'Location.class' was compiled against an incompatible version of com.mongodb.
[error] missing or invalid dependency detected while loading class file 'Title.class'.

@laughedelic
Copy link
Contributor

Wow 😮 I see such error for the first time. After quick googling I think it's some internal scala/sbt issue (also here). But this SO question suggests that probably you can add some other mongodb related dependency and it will help. Here, unfortunately, I cannot help you.

And a couple of things related to the sbt-s3-resolver plugin:

@Liorba
Copy link

Liorba commented Apr 1, 2017

at the moment it doesn't support resolving maven dependencies (we have #7, but no much progress there)

any updates on this one?

@laughedelic
Copy link
Contributor

@Liorba you mean #7?

At the moment we don't use this functionality ourselves, and we don't have time to implement it. So if anybody will make a pull-request, it will be good.

@Liorba
Copy link

Liorba commented Apr 2, 2017

@laughedelic yes..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants