Hi,
I noticed the following issue with your current master:
When building a jar file using ant: ant jar
, the created css-validator.jar is missing a dependency resulting in a crash:
roiex@Robins-PC:/mnt/e/GitHub/css-validator$ java -jar css-validator.jar http://localhost:4000
{output=text, profile=css3, vextwarning=false, warning=2, medium=all, lang=en}
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
at org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:161)
at org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:730)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:263)
at org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:112)
at org.apache.velocity.app.Velocity.init(Velocity.java:74)
at org.w3c.css.css.StyleSheetGenerator.<clinit>(StyleSheetGenerator.java:92)
at org.w3c.css.css.StyleReportFactory.getStyleReport(StyleReportFactory.java:18)
at org.w3c.css.css.CssValidator.handleRequest(CssValidator.java:194)
at org.w3c.css.css.CssValidator.main(CssValidator.java:163)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 9 more
Output of java -version
:
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
As you may notice this is not a direct dependency of css-validator, but an indirect dependency of apache velocity.
Given that you should perhaps consider updating your dependencies (all of them), (and maybe compile using java 8 because even java 8 got old/common by now), or even switch to gradle instead of using ant.
I opened this Repo in eclipse and for gods sake, please run a formatter on this codebase, the code is un-readable in some classes, not to mention a lot of dead code, if(true)
/if("" != null)
, raw generics statements etc. etc. etc.
I'm assuming some code has been generated by a decompiler? Definitely looks like it.
Anyways, enough ranting,
TL;DR: Priority 1 should be to fix this dependency, priority 2 should be to make your code readable.
I'd be happy to support you with any of the potential tasks I mentioned, if you want me to run a formatter add a dependency/fix the current one, create a gradle script or something I would be happy to do that, just tell me :)
I really think this Project is worth maintaining, because it is indeed pretty useful to have as some sort of test for static (or dynamic) websites being developed under version control.