Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to exclude paths from the searching? #17

Open
wimdeblauwe opened this issue Mar 28, 2017 · 8 comments
Open

Is there a way to exclude paths from the searching? #17

wimdeblauwe opened this issue Mar 28, 2017 · 8 comments

Comments

@wimdeblauwe
Copy link

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:

image

Is there any setting I can do to avoid that anything under docs gets matched?

@jamesward
Copy link
Member

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.

@wimdeblauwe
Copy link
Author

I am using Spring Boot 1.5.x with webjars-locator which does all the magic. Any way I can influence this magic?

@jamesward
Copy link
Member

Hmmm... I'm not sure. Maybe @royclarkson can help.

@royclarkson
Copy link

Appears there is a fix for the MultipleMatchesFoundException in Spring Framework. spring-projects/spring-framework#1420

@maybeec
Copy link

maybeec commented Jul 10, 2017

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).

@jamesward
Copy link
Member

Does Spring somehow expose the getFullPathExact method? That is the right way to do this, like:

locator.getFullPathExact("moment", "moment.js")

@maybeec
Copy link

maybeec commented Jul 11, 2017

The first parameter is the webjar name. So this API would end up in three matches as well for the example above.

@jamesward
Copy link
Member

The getFullPathExact doesn't do partial matching. It really just inserts the version between the WebJar name and the provided path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants