TeamCity cannot resolve test artifact from Nexus with error "Configuration is not public"

This is similar to sbt giving "not public config" depending on the test in the subproject , but we don't have an external Ivy file. We have

lazy val core = "com.huawei.scalan" %% "core" % "0.1-SNAPSHOT" % "compile->compile;test->test" 

lazy val enterprise = Project(
  id = "enterprise-edition",
  base = file(".")
).configs(ItTest).settings(commonSettings: _*).
  settings(libraryDependencies ++= Seq(core))


The dependency is taken from our Nexus repository configured as described at . This works great for developers, but TeamCity running on the same machine throws an error:

[warn] :: com.huawei.scalan # core_2.10; 0.1-SNAPSHOT: configuration not available in com.huawei.scalan # core_2.10; 0.1-SNAPSHOT: 'test'. This was required from com.huawei.scalan # enterprise-edition_2.10; 0.2-SNAPSHOT test

It certainly accesses the correct repository as it restores the configuration without any problem compile

. SBT version is 0.13.5. In the process of writing this question, I found a workaround: write dependency as

lazy val core = "com.huawei.scalan" %% "core" % "0.1-SNAPSHOT"

  settings(libraryDependencies ++= Seq(core, core % "test" classifier "tests"))


So the question is why the previous configuration doesn't work for TeamCity and does when used publishLocal



source to share

1 answer

This sbt issue seems to explain it: it would be a consequence of trying to get a test dependency if the same version was resolved by the Maven public repository.

A workaround would be to use git SHA version or SNAPSHOT for non-final build.



All Articles