diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/mavenint/PomExtraDependencyAttributes.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/mavenint/PomExtraDependencyAttributes.scala index 25ab896b..4160b600 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/mavenint/PomExtraDependencyAttributes.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/mavenint/PomExtraDependencyAttributes.scala @@ -78,9 +78,7 @@ object PomExtraDependencyAttributes { item.getQualifiedExtraAttributes.asInstanceOf[java.util.Map[String, String]].asScala.toMap } def filterCustomExtra(item: ExtendableItem, include: Boolean): Map[String, String] = - (qualifiedExtra(item) filterKeys { k => - qualifiedIsExtra(k) == include - }).toMap + qualifiedExtra(item).filterKeys { k => qualifiedIsExtra(k) == include }.toMap def qualifiedIsExtra(k: String): Boolean = k.endsWith(ScalaVersionKey) || k.endsWith(SbtVersionKey) @@ -107,17 +105,27 @@ object PomExtraDependencyAttributes { /** * Creates the "extra" property values for DependencyDescriptors that can be written into a maven pom - * so we don't loose the information. + * so we don't lose the information. * @param s * @return */ def writeDependencyExtra(s: Seq[DependencyDescriptor]): Seq[String] = s.flatMap { dd => val revId = dd.getDependencyRevisionId - if (filterCustomExtra(revId, include = true).isEmpty) + val filteredExtra = filterCustomExtra(revId, include = true) + if (filteredExtra.isEmpty) Nil - else - revId.encodeToString :: Nil + else { + import scala.collection.JavaConverters._ + val revId0 = ModuleRevisionId.newInstance( + revId.getOrganisation, + revId.getName, + revId.getBranch, + revId.getRevision, + filteredExtra.asJava + ) + revId0.encodeToString :: Nil + } } } diff --git a/ivy/src/test/scala/sbt/internal/librarymanagement/ModuleResolversTest.scala b/ivy/src/test/scala/sbt/internal/librarymanagement/ModuleResolversTest.scala index 96f4c5b2..94c30d24 100644 --- a/ivy/src/test/scala/sbt/internal/librarymanagement/ModuleResolversTest.scala +++ b/ivy/src/test/scala/sbt/internal/librarymanagement/ModuleResolversTest.scala @@ -3,13 +3,13 @@ package sbt.internal.librarymanagement import sbt.librarymanagement._ import sbt.librarymanagement.syntax._ import sbt.librarymanagement.ivy.UpdateOptions -import Resolver._ object ModuleResolversTest extends BaseIvySpecification { override final val resolvers = Vector( - DefaultMavenRepository, - JavaNet2Repository, - JCenterRepository, + MavenRepository( + "JFrog OSS Releases", + "https://releases.jfrog.io/artifactory/oss-releases/" + ), Resolver.sbtPluginRepo("releases") )