Search code examples
scalanexusscoveragescala-2.12sbt1.0

Scala sbt scoverage plugin resolution with Nexus proxy


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)


Solution

  • Set the Nexus proxy layout to permissive Nexus