CORDA-4003: Now support + in CorDapp filenames (#6673)

* CORDA-4003: Now cope with file: prefix not being in class path element.

* CORDA-4003: Switched to new URL type filter.

* CORDA-4003: Switched to a URL comparison. In the string comparison the scheme was removed in latest version of classgraph.

* CORDA-4003: Moved to latest version of classgraph that has support for + in filenames.

* CORDA-4003: Switched to accept version of the deprecated classgraph methods.
This commit is contained in:
Adel El-Beik 2020-09-01 10:30:49 +01:00 committed by GitHub
parent 7a7289c2f1
commit 14e23430c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -21,7 +21,7 @@ quasarVersion11=0.8.0_r3
jdkClassifier11=jdk11
proguardVersion=6.1.1
bouncycastleVersion=1.61
classgraphVersion=4.8.78
classgraphVersion=4.8.89
disruptorVersion=3.4.2
typesafeConfigVersion=1.3.4
jsr305Version=3.0.2

View File

@ -331,7 +331,7 @@ class JarScanningCordappLoader private constructor(private val cordappJarPaths:
val cordappElement = cordappJarPath.url.toString()
logger.info("Scanning CorDapp in $cordappElement")
val scanResult = ClassGraph()
.filterClasspathElements { elt -> elt == cordappElement }
.filterClasspathElementsByURL { elt -> elt == cordappJarPath.url }
.overrideClassLoaders(appClassLoader)
.ignoreParentClassLoaders()
.enableAllInfo()

View File

@ -56,11 +56,11 @@ data class CustomCordapp(
internal fun packageAsJar(file: Path) {
val classGraph = ClassGraph()
if (packages.isNotEmpty()) {
classGraph.whitelistPaths(*packages.map { it.replace('.', '/') }.toTypedArray())
classGraph.acceptPaths(*packages.map { it.replace('.', '/') }.toTypedArray())
}
if (classes.isNotEmpty()) {
classes.forEach { classGraph.addClassLoader(it.classLoader) }
classGraph.whitelistClasses(*classes.map { it.name }.toTypedArray())
classGraph.acceptClasses(*classes.map { it.name }.toTypedArray())
}
classGraph.enableClassInfo().pooledScan().use { scanResult ->

View File

@ -56,7 +56,7 @@ data class TestCordappImpl(val scanPackage: String, override val config: Map<Str
private fun findRootPaths(scanPackage: String): Set<Path> {
return packageToRootPaths.computeIfAbsent(scanPackage) {
val classGraph = ClassGraph().whitelistPaths(scanPackage.replace('.', '/'))
val classGraph = ClassGraph().acceptPaths(scanPackage.replace('.', '/'))
classGraph.pooledScan().use { scanResult ->
scanResult.allResources
.asSequence()