简体   繁体   中英

Rhino explicitly required for Jawr's LESS Processor

jawr-core has the following dependency (see artifact details ):

<dependency>
    <groupId>org.mozilla</groupId>
    <artifactId>rhino</artifactId>
    <scope>provided</scope>
</dependency>

When processing LESS files I'm facing an exception saying java.lang.NoClassDefFoundError: org/mozilla/javascript/ScriptableObject

If adding rhino dependency explicitly with scope compile to my project the exception is gone.

But why Jawr has a dependency on it with scope provided when it is required to process LESS files?

The servlet container my webapp is running on is Tomcat 7.

jawr have made all their dependencies provided , not just the rhino dependency.

It looks to me like they are really worried about getting in the way of your server's classpath.

At this link: http://jawr.java.net/docs/postprocessors.html#YUI_compressor , they state the following:

...which might be problematic if you already have rhino on your server's classpath...

Can only presume that is why they are all provided. You then explicitly need to include the dependencies that you require for the functionality of jawr that you want to use.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM