martin-g/wicket-webjars

large dependency set added

tkruse opened this issue · 6 comments

Hi,

I like wicket-webjars. As a comment, I noticed today it pulls several library jars:

Size      Name
313898 dom4j-1.6.1.jar
644148 javassist-3.12.1.GA.jar
102696 reflections-0.9.8.jar
 48853  wicket-webjars-0.4.3.jar

Making this a 1MB dependency (not excessive, but still not nice).
I believe that seems excessive for the normal usage of wicket-webjars (unless I miss something), so it would be nice if there was a lightweight version.

You can close this issue when no time or not enough interest.

mvn dependency:tree shows:

 de.agilecoders.wicket.webjars:wicket-webjars:jar:0.4.4-SNAPSHOT
+- org.reflections:reflections:jar:0.9.8:compile
|  +- com.google.guava:guava:jar:11.0.2:compile
|  |  \- com.google.code.findbugs:jsr305:jar:1.3.9:compile
|  +- javassist:javassist:jar:3.12.1.GA:compile
|  \- dom4j:dom4j:jar:1.6.1:compile
|     \- xml-apis:xml-apis:jar:1.0.b2:compile

I.e. they come as transitive dependencies of Reflections library which is used to find the latest/current version of a webjars resource.
You can try with specifying <exclusion>s in your pom.xml and see whether it still works.
I guess it may work for some cases and break for others.

I could do that, but I do not want to run into ClassNotFoundExceptions at runtime either, ever.
Additionally, I see that VfsDir uses

import org.jboss.vfs.VirtualFile

which is a "provided" dependency, which I guess is not provided at all when not running on JBoss.

Is it safe to assume that if we do not use the VfsJarAssetPathCollector, then we don't need either the reflections library nor any jboss library?

In that case I would still recommend putting the VfsJarAssetPathCollector into a separate wicket-webjars-jboss project, because users having to manually exclude transitive dependencies seems dirty to me.

For what it's worth, it seems that excluding that dependency works for us (nothing breaks). If nothing else, maybe the initial README could state that many/most users should include wicket-webjars by excluding those transitive dependencies.

I am testing with wicket-webjars-vfs module.
I like this explicit approach better.

The PR has been merged long time ago.