rquinio / l10n-maven-plugin

:abcd: Maven plugin to validate localization resources in Java properties files
MIT License
3 stars 1 forks source link

HTML validator fails to initialize. Because I'm behind an authenticating proxy? #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Great tool!

Which version of the plugin are you using?
1.7

What steps will reproduce the problem?

When I run mvn clean package, l10n-maven-plugin:1.7:validate seems to run fine 
but includes the following error and stacktrace:

[ERROR] Could not initialize HtmlValidator
org.xml.sax.SAXParseException; systemId: 
jar:file:/C:/Users/DiesK/.m2/repository/com/googlecode/l10n-maven-plugin/l10n-ma
ven-plugin/1.7/l10n-maven-plugin-1.7.jar!/xhtml1-transitional.xsd; lineNumber: 
351; columnNumber: 35; src-resolve: Cannot resolve the name 'xml:lang' to a(n) 
'attribute declaration' component.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDHandler.getGlobalDecl(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDAttributeTraverser.traverseLocal(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDAbstractTraverser.traverseAttrsAndAttrGrps(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDAttributeGroupTraverser.traverseGlobal(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDHandler.traverseSchemas(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
        at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
        at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:591)
        at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:623)
        at com.googlecode.l10nmavenplugin.validators.property.HtmlValidator.<init>(HtmlValidator.java:153)
        at com.googlecode.l10nmavenplugin.ValidateMojo.initialize(ValidateMojo.java:278)
        at com.googlecode.l10nmavenplugin.ValidateMojo.execute(ValidateMojo.java:337)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

What would be the expected output?
No error.
Also, I have the impression it slows down the build process.

Please provide any additional information below.

I have no XML files in my project. My main html file contains a "lang":

<!doctype html>
<html lang="<fmt:message key='document.language.code' bundle='${site}'/>">

(I use JSTL to inject the language code)

Also, I'm behind a corporate proxy. I have configured my proxy credentials in 
"http_proxy" and in maven's settings.xml.

I would like to be able to get the HTML validator working by either bundling 
the required schema file somewhere or getting it to authenticate to our proxy, 
or if not possible, just disable it so it won't try to access the Internet.

Original issue reported on code.google.com by dies...@gmail.com on 20 Mar 2014 at 10:15

GoogleCodeExporter commented 9 years ago
About "the impression it slows down the build", this is based on a 20 sec. wait 
(no output) during the build between the following output messages:

[WARNING] No dictionary file under folder d:\src\main\resources\messages. 
Skipping spellcheck validation.

and

[ERROR] Could not initialize HtmlValidator

Original comment by dies...@gmail.com on 21 Mar 2014 at 1:27

GoogleCodeExporter commented 9 years ago
This noticed adding <xhtmlSchema>xhtml5.xsd</xhtmlSchema> makes the error, and 
the delay, go away :)

Original comment by dies...@gmail.com on 21 Mar 2014 at 1:35

GoogleCodeExporter commented 9 years ago
Thanks for the stacktrace, I knew something was wrong in there, but you nailed 
down the issue !
There was an absolute import in the xhtml1 schemas which was causing latency:
<xs:import schemaLocation="http://www.w3.org/2001/xml.xsd"/>
This was the cause of the average 20 sec build slowness, and the issue wasn't 
present in the xhtml5 schema.

Original comment by romain.q...@gmail.com on 23 Mar 2014 at 4:39

GoogleCodeExporter commented 9 years ago

Original comment by romain.q...@gmail.com on 23 Mar 2014 at 4:40

GoogleCodeExporter commented 9 years ago
Wrong status

Original comment by romain.q...@gmail.com on 23 Mar 2014 at 9:13

GoogleCodeExporter commented 9 years ago
Issue has been fixed in 1.8

Original comment by romain.q...@gmail.com on 30 Nov 2014 at 11:53