Right now if you want to use a resource from a WebJar you need to do something like this:
The WebJar version is hard-coded so whenever you update the dependency version in your POM file you need to remember to update your source files. Putting the version in the source files is a bad practice anyway.
The WebJar version can be determined using the Extension Manager so it shouldn't be mandatory to specify it. You may still want to be able to specify the version if you have multiple applications using different major versions of the same WebJar but the version should be optional.
I propose this API:
You just have to specify the WebJar id (which is groupId:artifactId but you can omit the groupId if it is 'org.webjars') and the resource path (starting from the version folder).
I think we also need a way to pass parameters to a WebJar resource so this should work too:
We should of course keep the old API for backwards compatibility.