Java 为什么axistools maven插件试图访问此相对模式位置?
我们正在用Axis1.x做一个web服务项目,我在让Maven构建正常工作方面遇到了问题 我做一个Java 为什么axistools maven插件试图访问此相对模式位置?,java,maven-2,axis,wsdl2java,Java,Maven 2,Axis,Wsdl2java,我们正在用Axis1.x做一个web服务项目,我在让Maven构建正常工作方面遇到了问题 我做一个 mvn clean generate-sources 这触发了axistools maven插件的wsdl2java目标。它最终会以失败告终 [INFO] [axistools:wsdl2java {execution: generate-project}] [INFO] about to add compile source root [INFO] Processing wsdl: C:\P
mvn clean generate-sources
这触发了axistools maven插件的wsdl2java
目标。它最终会以失败告终
[INFO] [axistools:wsdl2java {execution: generate-project}]
[INFO] about to add compile source root
[INFO] Processing wsdl: C:\Project\src\main\webapp\WEB-INF\wsdl\project.wsdl
Jan 24, 2011 11:24:58 AM org.apache.axis.utils.JavaUtils isAttachmentSupported
WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error generating Java code from WSDL.
Embedded error: Error running Axis
C:\Project\src\main\webapp\WEB-INF\project.xsd (The system cannot find the file specified)
这是正确的。那个文件不存在。(并且-e不产生任何其他有用信息——它是一个LifecycleExecutionException,由MojoExecutionException引起,由AxisPluginException引起,由FileNotFoundException引起。)
关键是,它不应该搜索WEB-INF\project.xsd
,它应该访问WEB-INF\wsdl\project.xsd
以下是WSDL所说的:
<wsdl:types>
<xsd:schema targetNamespace="http://domain/project/">
<xsd:import namespace="http://domain/schema/" schemaLocation="project.xsd"/>
</xsd:schema>
</wsdl:types>
如果你和我一样,现在认为/project.xsd
可能有用。。。不,抱歉,这使它可以再次直接搜索WEB-INF/project.xsd
编辑2:好吧,现在axistools只是在取笑我
。/project.xsd
-->
src/main/webapp/project.xsd
(错误)
。/wsdl/project.xsd
-->
src/main/webapp/wsdl/project.xsd
(错误)
。/WEB-INF/wsdl/project.xsd
-->
src/main/webapp/WEB-INF/WEB-INF/wsdl/project.xsd
(错误)
作为提醒,正确的路径应该是
src/main/webapp/WEB-INF/wsdl/project.xsd
尝试使用useEmitter标记,如:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
<useEmitter>true</useEmitter>
org.codehaus.mojo
AxisToolsMaven插件
1.4
真的
…通过确保项目位置的路径不包含空格,我能够解决此问题。因此,Win XP上的默认位置将不起作用(“文档和设置”)不幸的是,当启用
时
功能不再起作用
所以我不得不把这一代人分成两次“处决”
- 首先,所有不带XSD且
true
- 然后是带有XSD的include(幸运的是我只有一个)和
(文件名显式添加到true
)
Embedded error: Error running Axis
WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema):
faultCode=OTHER_ERROR: An error occurred trying to resolve
schema referenced at 'wsdl\project.xsd', relative to
'file:/C:/Project/src/main/webapp/WEB-INF/wsdl/project.wsdl'.:
This file was not found:
file:/C:/Project/src/main/webapp/WEB-INF/wsdl/wsdl/project.xsd
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
<useEmitter>true</useEmitter>