Sbt Managed dependency getting the wrong version

I use SBT through the Play platform, and I am having a problem with the management dependencies in the build.sbt file.

My build.sbt file:

name := "name"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
javaJdbc,
javaEbean,
cache,
"de.undercouch" % "bson4jackson" % "2.1.0" force(),
"com.fasterxml.jackson.core" % "jackson-databind" % "2.1.0" force(),
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.1.0" force(),
"com.fasterxml.jackson.core" % "jackson-core" % "2.1.0" force(),
"org.mongodb" % "mongo-java-driver" % "2.11.3",
"org.jongo" % "jongo" % "0.4",
"uk.co.panaxiom" %% "play-jongo" % "0.6.0-jongo0.4",
"org.glassfish.jersey.core" % "jersey-client" % "2.4",
"org.glassfish.jersey.core" % "jersey-common" % "2.4",
"org.glassfish.jersey.core" % "jersey-server" % "2.4",
"org.glassfish.jersey.containers" % "jersey-container-jdk-http" % "2.4"
)     

play.Project.playJavaSettings

When I try to build my production environment (Ubuntu), I get the error message: M [2K [0m [[0minfo [0m] [0mResolving org.glassfish.jersey.core # jersey-client; 2.4 ... [0m

M[2K[0m[[0minfo[0m] [0mResolving org.glassfish.jersey.core#jersey-common;2.4 ...[0m

M[2K[0m[[0minfo[0m] [0mResolving javax.ws.rs#javax.ws.rs-api;2.0 ...[0m

M[2K[0m[[0minfo[0m] [0mResolving javax.annotation#javax.annotation-api;1.2 ...[0m

M[2K[0m[[0minfo[0m] [0mResolving org.glassfish.hk2#hk2-api;2.2.0-b21 ...[0m
M[2K[0m[[0minfo[0m] [0mResolving org.glassfish.hk2#hk2-utils;2.4 ...[0m
[0m[[33mwarn[0m] [0m    module not found: org.glassfish.hk2#hk2-utils;2.4[0m
[0m[[33mwarn[0m] [0m==== local: tried[0m
[0m[[33mwarn[0m] [0m  /opt/play/repository/local/org.glassfish.hk2/hk2-utils/2.4/ivys/ivy.xml[0m
[0m[[33mwarn[0m] [0m==== Maven2 Local: tried[0m
[0m[[33mwarn[0m] [0m  file:/root/.m2/repository/org/glassfish/hk2/hk2-utils/2.4/hk2-utils-2.4.pom[0m

Interestingly, this assembly is no problem in my development environment (also Ubuntu and I believe that we are running the same versions of everything that is used in the production environment.)

The problem seems to be that sbt is trying to get version 2.4 of hk2-utils, which does not exist. I traced this to the hk2-api package, which contains the following in its POM file:

<dependency>
  <groupId>org.glassfish.hk2</groupId>
  <artifactId>hk2-utils</artifactId>    
  <version>${project.version}</version>
</dependency>

, , ${project.version} 2.4 ( jersey-client ) , . org.glassfish.hk2#hk2-api;2.2.0-b21.

, sbt, sbt . , - POM hk2-api.

+4
2

POMS , , . , SBT.

dependencyOverrides ~= { overrides => 
  overrides + "org.glassfish.hk2" % "hk2-utils" % "2.2.0-b21" 
}

dependencyOverrides sbt , , . , , , . (: http://www.scala-sbt.org/0.13.0/docs/Detailed-Topics/Library-Management.html#forcing-a-revision-without-introducing-a-dependency)

build.sbt hk2-utils 2.2.0-b21 .

+1

sbt. , . .ivy2/cache sbt .

0

All Articles