You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+29
Original file line number
Diff line number
Diff line change
@@ -31,3 +31,32 @@ WebJarVersionLocator webJarVersionLocator = new WebJarVersionLocator();
31
31
webJarVersionLocator.version("bootstrap"); // cache miss
32
32
webJarVersionLocator.version("bootstrap"); // cache hit, avoiding looking up metadata in the classpath
33
33
```
34
+
35
+
Custom WebJars
36
+
--------------------------------
37
+
38
+
By default, `webjars-locator-lite` only supports WebJars with the Maven group IDs of `org.webjars` and `org.webjars.npm`.
39
+
To support custom WebJars, you can provide a `webjars-locator.properties` file to register those WebJars with the locator.
40
+
41
+
The `webjars-locator.properties` file must be located in `META-INF/resources/`.
42
+
43
+
For a WebJar that has its resource files located in `META-INF/resources/mywebjar/3.2.1/`, the file would look like this:
44
+
45
+
```
46
+
mywebjar.version=3.2.1
47
+
```
48
+
49
+
For custom WebJars, it is recommended to package the file within the WebJar.
50
+
However, for older releases that do not include this file, it is also possible to add it to your project directly.
51
+
52
+
Multiple WebJar versions can be defined in a single file:
53
+
54
+
```
55
+
mywebjar.version=3.2.1
56
+
anotherwebjar.version=1.4.3
57
+
```
58
+
59
+
> This allows the use of [legacy](https://github.com/webjars/webjars/issues/2039)`org.webjars.bower` WebJars. However, `org.webjars.bowergithub.xyz` WebJars are not supported because their
60
+
> resource paths are missing the version part needed for `webjars-locator-lite`.
61
+
62
+
You can find an [example file](https://github.com/webjars/webjars-locator-lite/blob/main/src/test/resources/META-INF/resources/webjars-locator.properties) in our tests.
0 commit comments