Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
脱机使用XMLMaven插件_Xml_Maven 2_Maven_Xslt - Fatal编程技术网

脱机使用XMLMaven插件

脱机使用XMLMaven插件,xml,maven-2,maven,xslt,Xml,Maven 2,Maven,Xslt,我已将xmlmaven插件配置为使用本地定义的XSLT模式运行,以便验证项目中定义的所有XSLT文件: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>xml-maven-plugin</artifactId> <version>1.0-beta-3</version> <executions>

我已将
xmlmaven插件
配置为使用本地定义的XSLT模式运行,以便验证项目中定义的所有XSLT文件:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>xml-maven-plugin</artifactId>
    <version>1.0-beta-3</version>
    <executions>
        <execution>
            <id>validate-xsl</id>
            <goals>
                <goal>validate</goal>
            </goals>
            <phase>test</phase>
        </execution>
    </executions>
    <configuration>
        <validationSets>
            <validationSet>
                 <dir>${project.build.resources[0].directory}</dir>
                 <systemId>${project.build.testResources[0].directory}/schema-for-xslt20.xsd</systemId>
                 <includes>
                     <include>**/*.xsl</include>
                 </includes>
             </validationSet>
         </validationSets>
     </configuration>
 </plugin>
我已经读到这可以通过解决,但我没有找到任何完整的参考,这与插件的工作


如何使此验证脱机工作?

您可以在验证目标属性中指定目录,如下所述:


XML目录是标准的东西,您试过了吗?它不起作用了吗?实际上,您需要将您的模式(或DTD)命名空间映射到本地文件系统中的位置。

谢谢。你能给我一个这样的目录对于XSLT模式应该是什么样的例子吗?我手头没有它,但我记得它在过去的项目中起作用。这看起来与我一直使用的非常接近:另外,您是否尝试过在“脱机”模式下运行maven?只是胡乱猜测:)
[ERROR] Failed to execute goal org.codehaus.mojo:xml-maven-plugin:1.0-beta-3:validate (default-cli) on project projectdotnet: Failed to load schema with public ID null, system ID /home/robert/..../src/test/resources/schema-for-xslt20.xsd: src-resolve: Cannot resolve the name 'xs:schema' to a(n) 'element declaration' component. -> [Help 1]