0

I am using scoverage plugin in my project project/plugins.sbt:

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")

This resolves fine when I do not use our company nexus.

To test our nexus proxy I added below at ~./sbt/repositories:

[repositories]
    local
    maven-releases: https://repo.example.net/nexus/repository/proxy-central.maven.org/
    ivy-releases: https://repo.example.net/nexus/repository/proxy-repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
    sbt-plugin-releases: https://repo.example.net/nexus/repository/proxy-repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]

I delete the ~./ivy2/cache and when I try compiling:

[warn] ==== maven-releases: tried
[warn]   https://repo.jamba.net/nexus/repository/proxy-central.maven.org/org/scoverage/sbt-scoverage_2.12_1.0/1.5.1/sbt-scoverage-1.5.1.pom
[warn] ==== ivy-releases: tried
[warn]   https://repo.jamba.net/nexus/repository/proxy-repo.typesafe.com/typesafe/ivy-releases/org.scoverage/sbt-scoverage/scala_2.12/sbt_1.0/1.5.1/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn]   https://repo.jamba.net/nexus/repository/proxy-repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scoverage/sbt-scoverage/scala_2.12/sbt_1.0/1.5.1/ivys/ivy.xml

    [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
    [warn]  ::          UNRESOLVED DEPENDENCIES         ::
    [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
    [warn]  :: org.scoverage#sbt-scoverage;1.5.1: not found
    [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
    [warn] 
    [warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
    [warn]      org.scoverage:sbt-scoverage:1.5.1 (scalaVersion=2.12, sbtVersion=1.0)

I noticed that sbt coverage has a directory structure which includes scala and sbt version: https://repo1.maven.org/maven2/org/scoverage/sbt-scoverage_2.12_1.0/1.5.1/sbt-scoverage-1.5.1.pom

I also tried to change project/plugins.sbt to no avail:

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1", scalaVersion="2.12", sbtVersion="1.0")

Is there a reason why my maven proxy is not downloading this plugin from maven central (although it clearly exists)

Note: the proxy resolution works for ivy style releases and other maven releases.

EDIT: Note I: Resolution of artifacts without using the proxy (directly from maven central) works perfectly. That is how I concluded that there must be something missing in the proxy configuration. Any/all pointers would be helpful. Note II: Resolution of other artifacts (including sbt-assembly plugin, sbt itself, scala-reflect etc works perfectly with my proxy)

irrelevantUser
  • 1,172
  • 18
  • 35
  • Is this plugin the only artifact that is not downloading? Is everything working when you remove this plugin from `project/plugins.sbt` (and it's settings from `build.sbt`). – Grzegorz Slowikowski Jun 22 '19 at 12:33
  • Yes, this is the only artifact which is not downloading. Everything else just works using our proxy. – irrelevantUser Jun 23 '19 at 14:55
  • SBT and most SBT plugins are not deployed to Maven central. I think, there must be something wrong with Maven central proxy configuration in your Nexus. Can you try to build any simple Maven project to see if it fails as well or not? – Grzegorz Slowikowski Jun 24 '19 at 23:44
  • Yes, you make a good point. I however can see the scoverage plugin in maven central "https://repo1.maven.org/maven2/org/scoverage/sbt-scoverage_2.12_1.0/1.5.1/sbt-scoverage-1.5.1.pom": I also tried building the project using maven, and have the same issue. I suspect it has got to do with the suffix "2.12_1.0" in "sbt-scoverage_2.12_1.0". I am simply blanking on the proxy configuration that could help here. – irrelevantUser Jun 25 '19 at 07:58
  • FYI, this got resolved by simply setting the Nexus proxy layout to `permissive`! – irrelevantUser Jun 25 '19 at 13:59

1 Answers1

0

Set the Nexus proxy layout to permissive Nexus

irrelevantUser
  • 1,172
  • 18
  • 35