4

My SBT 1.1.0 setup fails to resolve parent dependency as a POM file.

We have several libraries published in a local Sonatype repository. All of them depend on 1 maven project with <packaging>pom</packaging> property set. So there is no JAR file in the repo, only declarative POM file for this parent project and this POM is available and accessible.

SBT 0.13.17 resolves this chain successfully and downloads libraries plus this parent POM.

But SBT 1.x fails with error:

unresolved dependency: ... unable to get resource for commons-dependencies-parent-2.165.jar

It's trying to download JAR instead of POM file.

I was trying to specify this parent dependency explicitly with

"com.zeptolab.commons" % "commons-dependencies-parent" % "2.165"

But the bug persists.

Any ideas or workarounds? Have already switched all projects to SBT 1.1.0 except this one due to this problem.

UPD. Custom resolver is properly set up and working with sbt 0.13.17

UPD2 Made an issue https://github.com/sbt/sbt/issues/3953

Eugene Zhulkov
  • 505
  • 3
  • 13
  • what is the exact version of sbt you are using? – user51 Feb 13 '18 at 17:34
  • With any 1.x version. Now it’s 1.1.0 – Eugene Zhulkov Feb 13 '18 at 22:26
  • looks like the artifcat for `com.zeptolab.commons` is not standard maven. You need to include the `resolvers += ` which has the dependency you are adding in your project. – user51 Feb 13 '18 at 22:54
  • I’ve written that sbt 0.13.17 works and custom resolvers with my local repo are properly set up with resolvers += – Eugene Zhulkov Feb 14 '18 at 04:56
  • okay looks like there is bug in SBT. I had some similar issue https://stackoverflow.com/questions/46982706/java-lang-classnotfoundexception-scala-int-when-using-akka-2-5-6-with-sbt-versi which was working in 0.13.16 but not in 1.0.x. So make small project that replicates your issue and file a bug in SBT https://github.com/sbt/sbt. – user51 Feb 14 '18 at 18:40
  • It's definitely not the same issue. In my case I don't have exceptions. SBT just trying to download JAR file instead of POM file from local repo. – Eugene Zhulkov Feb 14 '18 at 20:57
  • I'm not saying it is same issue. It is similar issue(i.e., something works in previous version but not in latest version). Even for my issue I thought the same, but the guy from Lightbend convinced me that it is SBT issue. you can go through the conversations in the link I posted above. – user51 Feb 14 '18 at 22:13

1 Answers1

2

Found a workaround for this issue. Looks like there is a bug in new http client. So setting updateOptions := updateOptions.value.withGigahorse(false) helps.

Eugene Zhulkov
  • 505
  • 3
  • 13