You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[info] scala.MatchError: cache:publish-m2-local: /Users/dnw/.m2/repository (of class sbt.librarymanagement.MavenCache)
[info] at sbt.internal.librarymanagement.ConvertResolver$$anonfun$defaultConvert$1.applyOrElse(ConvertResolver.scala:117)
[info] at sbt.internal.librarymanagement.ConvertResolver$$anonfun$defaultConvert$1.applyOrElse(ConvertResolver.scala:115)
[info] at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
[info] at sbt.internal.librarymanagement.ConvertResolver$.apply(ConvertResolver.scala:112)
[info] at sbt.internal.librarymanagement.IvySbt$$anonfun$mapResolvers$1$1.apply(Ivy.scala:279)
[info] at sbt.internal.librarymanagement.IvySbt$$anonfun$mapResolvers$1$1.apply(Ivy.scala:279)
[info] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
[info] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
[info] at scala.collection.Iterator$class.foreach(Iterator.scala:893)
[info] at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
[info] at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
[info] at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
[info] at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
[info] at scala.collection.AbstractTraversable.map(Traversable.scala:104)
[info] at sbt.internal.librarymanagement.IvySbt$.mapResolvers$1(Ivy.scala:279)
The reason is that in the current (85e7cf6) version of lm MavenCache is no longer a subclass of MavenRepository, which is what defaultConvert is expecting.
/** An instance of a remote maven repository. Note: This will use Aether/Maven to resolve artifacts. */sealedcaseclassMavenRepository(name: String, root: String) extendsResolver {
overridedeftoString=s"$name: $root"defisCache:Boolean=falsedeflocalIfFile:Boolean=truedefwithLocalIfFile(value: Boolean) =newMavenRepository(name, root) { overridedeflocalIfFile= value }
}
/** * An instance of maven CACHE directory. You cannot treat a cache directory the same as a a remote repository because * the metadata is different (see Aether ML discussion).*/finalclassMavenCache(name: String, valrootFile:File) extendsMavenRepository(name, rootFile.toURI.toURL.toString) {
overridevaltoString=s"cache:$name: ${rootFile.getAbsolutePath}"overridedefisCache:Boolean=true
}
objectMavenCache {
defapply(name: String, rootFile: File):MavenCache=newMavenCache(name, rootFile)
}
{
"name": "IMavenRepository",
"namespace": "sbt.librarymanagement",
"target": "Scala",
"type": "interface",
"doc": "An instance of a remote maven repository. Note: This will use Aether/Maven to resolve artifacts.",
"fields": [
{ "name": "root", "type": "String" },
{ "name": "localIfFile", "type": "boolean", "default": "true", "since": "0.0.1" }
],
"types": [
{
"name": "MavenRepository",
"namespace": "sbt.librarymanagement",
"target": "Scala",
"type": "record",
"toString": "s\"$name: $root\""
},
{
"name": "MavenCache",
"namespace": "sbt.librarymanagement",
"target": "Scala",
"type": "record",
"doc": [
"An instance of maven CACHE directory. You cannot treat a cache directory the same as a a remote repository because",
"the metadata is different (see Aether ML discussion)."
],
"fields": [
{ "name": "rootFile", "type": "java.io.File" }
],
"extra": "def this(name: String, rootFile: java.io.File) = this(name, rootFile.toURI.toURL.toString, true, rootFile)",
"toString": "s\"cache:$name: ${rootFile.getAbsolutePath}\"",
"extraCompanion": "def apply(name: String, rootFile: java.io.File): MavenCache = new MavenCache(name, rootFile)"
}
]
},
ie. an IMavenRepository parent abstract class, and MavenRepository and MavenCache subclasses
There are 3 options:
Keep this hierarchy, change all the code that expected MavenRepository to now expect IMavenRepository.
Make MavenRepository the parent abstract class, and MavenRepo/MavenCache the leaves, change all invocations of new MavenRepository(.. to either new MavenRepo(.. or MavenRepository(..
Model it in Scala, not in JSON, creating a concrete sealed MavenRepository class and a leaf final MavenCache class.
I'm getting these when running scripted in sbt:
The reason is that in the current (85e7cf6) version of lm MavenCache is no longer a subclass of MavenRepository, which is what
defaultConvert
is expecting.Here's the class hierarchy in v0.13.13:
The class hierarchy that @Duhemm created:
ie. an
IMavenRepository
parent abstract class, andMavenRepository
andMavenCache
subclassesThere are 3 options:
MavenRepository
to now expectIMavenRepository
.MavenRepository
the parent abstract class, andMavenRepo
/MavenCache
the leaves, change all invocations ofnew MavenRepository(..
to eithernew MavenRepo(..
orMavenRepository(..
MavenRepository
class and a leaf finalMavenCache
class.@eed3si9n what do you prefer?
The text was updated successfully, but these errors were encountered: