mirror of https://github.com/sbt/sbt.git
[2.x] fix: Use strict matching for scala-library jar detection (#8507)
Fixes #7511 The previous check used contains("scala-library") which incorrectly matched any jar with that substring anywhere in the filename, causing user libraries named like "my-scala-library-foo" to be misclassified as the Scala standard library and filtered from the classpath. Changed to use exact match (scala-library.jar) or prefix match (scala-library-*) to only match the actual Scala library jars, consistent with how scala-reflect is detected on line 199.
This commit is contained in:
parent
3a9e1ec725
commit
f2a5ae7219
|
|
@ -182,8 +182,9 @@ private[sbt] object ClassLoaders {
|
|||
cpFiles
|
||||
.filter(f => {
|
||||
val name = f.getName
|
||||
name.contains(ArtifactInfo.ScalaLibraryID) || si.libraryJars
|
||||
.exists(_.getName == name)
|
||||
name == s"${ArtifactInfo.ScalaLibraryID}.jar" ||
|
||||
name.startsWith(s"${ArtifactInfo.ScalaLibraryID}-") ||
|
||||
si.libraryJars.exists(_.getName == name)
|
||||
})
|
||||
.toArray
|
||||
else si.libraryJars
|
||||
|
|
|
|||
Loading…
Reference in New Issue