-
Notifications
You must be signed in to change notification settings - Fork 295
Description
The wicketstuff-tinymce6 module hardcodes the path to the TinyMCE JS in the Webjar with "current" instead of the version number. How is that supposed to work?
TinyMCESettings:
public static final ResourceReference TINYMCE_JS_REF = new JavaScriptResourceReference(
TinyMceBehavior.class, "../../../webjars/tinymce/current/tinymce.js");
public static final ResourceReference TINYMCE_JS_REF_MIN = new JavaScriptResourceReference(
TinyMceBehavior.class, "../../../webjars/tinymce/current/tinymce.min.js");
pom.xml:
org.webjars.npm
tinymce
6.8.3
$ jar tf ~/.m2/repository/org/webjars/npm/tinymce/6.8.3/tinymce-6.8.3.jar | grep tinymce.js
META-INF/resources/webjars/tinymce/6.8.3/tinymce.js
Unsurprisingly, the example does not work:
$ mvn -Dexec.mainClass=org.wicketstuff.examples.tinymce.Start -Dexec.classpathScope=test test-compile exec:java
[...]
[qtp493343679-81] WARN org.apache.wicket.request.resource.PackageResource - resource [path = webjars/tinymce/current/tinymce.js, style = null, variation = null, locale = null]: Unable to find resource (status=404)
Either change the path in TinyMCESettings to match the Webjar ("6.8.3" instead of "current"), or use something like org.webjars:webjars-servlet-2.x and get rid of the "current/" segment in the path.
As far as I can tell, this "current" segment is only generated by de.agilecoders.wicket.webjars:wicket-webjars which is quite useless as it only works for its own IWebjarsResourceReference derived classes (see WebjarsResourceFinder#find) and with a massive amount of code only replicates what the container does anyway. In any case, neither is this artifact used by the TinyMCE6 module, nor would it work if it was, since TinyMCESettings declares standard JavaScriptResourceReferences.