在使用maven构建时无法找到schemalocation

时间:2014-12-10 11:41:42

标签: maven xsd wsdl axis2 executionexception

我正在尝试使用maven构建一个包含wsdl和xsd的项目。

当我建造它时,我正在

[ERROR] Failed to execute goal org.codehaus.mojo:axistools-maven-plugin:1.4:wsdl2java (default) on project (project_name)
Error generating Java code from WSDL. Error running Axis: C:\(project_name)\src\main\resource\xsd\schema.xsd (The system cannot find the file specified) -> [Help 1]

我的schema.xsd存在于src \ main \ resource \ nms \ xsd \ schema.xsd

我的schema.wsdl存在于src \ main \ resource \ nms \ wsdl \ schema.wsdl

schema.wsdl中的

schemaLocation是

<xsd:import namespace="nms" schemaLocation="../xsd/schema.xsd"/>

根据wsdl xsd存在于正确的位置,但是axis2工具在不同的文件夹中搜索它。 给我一些帮助,谢谢。

maven wsdl2java配置

    <dependency>
        <groupId>axis</groupId>
        <artifactId>axis-wsdl4j</artifactId>
        <version>1.5.1</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>wsdl4j</groupId>
        <artifactId>wsdl4j</artifactId>
        <version>1.5.1</version>
        <scope>provided</scope>
    </dependency>



    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>axistools-maven-plugin</artifactId>
        <version>1.4</version>
        <configuration>
            <verbose>false</verbose>
        <sourceDirectory>src/main/resources/</sourceDirectory>
            <wsdlFiles>
                <wsdlFile>schema.wsdl</wsdlFile>

            </wsdlFiles>
        </configuration>
        <executions>
            <execution>
                <goals>
                    <goal>wsdl2java</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

0 个答案:

没有答案