Open wimdeblauwe opened 7 years ago
Can you try to use getFullPathExact
: https://javadoccentral.herokuapp.com/org.webjars/webjars-locator-core/0.32/org/webjars/WebJarAssetLocator.html#getFullPathExact-java.lang.String-java.lang.String-
Like: webJarAssetLocator.getFullPathExact("bootstrap-select", "dist/css/bootstrap-select.min.css")
Let me know if that works.
I am using Spring Boot 1.5.x with webjars-locator
which does all the magic. Any way I can influence this magic?
Hmmm... I'm not sure. Maybe @royclarkson can help.
Appears there is a fix for the MultipleMatchesFoundException
in Spring Framework. https://github.com/spring-projects/spring-framework/pull/1420
The current implementation even fails for jars, which declare a packed file equally named as one of the source files. I just made a test with moment.js, which serves multiple moment.js files:
[
META-INF/resources/webjars/moment/2.18.1/src/lib/moment/moment.js,
META-INF/resources/webjars/moment/2.18.1/src/moment.js,
META-INF/resources/webjars/moment/2.18.1/moment.js
]
However, the first entry in the sorted list already gives you the correct pointer (last element of the list).
Does Spring somehow expose the getFullPathExact
method? That is the right way to do this, like:
locator.getFullPathExact("moment", "moment.js")
The first parameter is the webjar name. So this API would end up in three matches as well for the example above.
The getFullPathExact
doesn't do partial matching. It really just inserts the version between the WebJar name and the provided path.
I want to use bootstrap-select (https://silviomoreto.github.io/bootstrap-select/) with Webjars. However, I get a
MultipleMatchesFoundException
. Which is normal given the structure of the webjar:Is there any setting I can do to avoid that anything under
docs
gets matched?