Closed agentgt closed 2 weeks ago
I tried to not add the dependency, but then escape got too complicated. So, yea please send a PR. Thank you.
@jknack PR added. Feel free to edit it. I did not bother adding any tests as I assume there is probably already one for this.
@jknack
I assume the commons-text was added to fix some escaping issues with
jooby-apt
.I highly recommend you just pull out what you need because it currently is a breaking show stopper for us. Actually any annotation processor really should not have any dependencies as veritable shit show of classpath problems happen including the commons-text/commons-lang3 issue.
Here is why.
We have commons-lang3 as a
runtime
dependency because we ban that jar downstream however other libraries use it (in irony the only other library that uses it at the moment for us is handlebars).So here is what happens the annotation processor runs but it does not have access to
<scope>runtime</scope>
jars. So you get a classpath exception like:Lucky for us I have already pulled out the escaping from commons-text you need in my own project JStachio: https://github.com/jstachio/jstachio/tree/main/compiler/apt/src/main/java/io/jstach/apt/internal/escape
Just copy that entire
escape
package and put intojooby-apt
and callEscapeUtil.escapeJava
.I can put in a PR today if you like.