我很难就我的项目发表意见。该项目是一个多模块的maven项目,可从https://svn.opentripplanner.org/trunk获得。我想要的只是API文档。没别的了。我们曾经通过Maven和Hudson让它工作,但是它在一段时间前就坏了,而设置它的人是不可用的。实际上,我更愿意通过命令行接口来实现这一点,但是如果有人有Maven解决方案,我就接受它。
我的命令行是:
/home/novalis/otp/enunciate-1.23/bin/enunciate -v -f /home/novalis/otp/workspace/opentripplanner/opentripplanner-api-webapp/enunciate.xml `find /home/novalis/otp/workspace/opentripplanner/ -name *.java -type f |grep -v /test/`我的enunciate.xml看起来是这样的:
<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.17.xsd">
<services>
<rest>
<content-types>
<content-type type="text/plain" id="txt"/>
</content-types>
</rest>
</services>
<modules>
<c disabled="true"/>
<obj-c disabled="true"/>
<csharp disabled="true"/>
<jaxws-client disabled="true"/>
<docs title="OpenTripPlanner API"
base="src/main/resources/docs-theme"/>
</modules>
</enunciate> 我宣布的输出是:
initializing enunciate.
invoking enunciate:generate step...
error: Could not create declaration for annotation type Autowire
error: Could not create declaration for annotation type Component
error: Could not create declaration for annotation type Autowired
error: Could not create declaration for annotation type Required
4 errors
Exception in thread "main" org.codehaus.enunciate.contract.validation.ValidationException: /home/novalis/otp/workspace/opentripplanner/opentripplanner-routing/src/main/java/org/opentripplanner/routing/patch/StopNotePatch.java:58: stop: adapter org.opentripplanner.routing.patch.AgencyAndIdAdapter does not adapt AgencyAndId
at org.codehaus.enunciate.contract.jaxb.adapters.AdapterUtil.findAdapterType(AdapterUtil.java:134)
at org.codehaus.enunciate.contract.jaxb.adapters.AdapterUtil.findAdapterType(AdapterUtil.java:57)
[more traceback snipped]AgencyAndIdAdapter确实适应了AgencyAndId。当我运行它时,实际的代码工作得很好。我尝试过用XmlAdapter构建一个小测试用例来适应一个随机Java类(JPanel),它运行得很好。所以我想不出如何进一步减少这个问题。
我不认为Autowire/Component/etc的错误会导致这种情况,因为如果我排除了所有包含这些注释的文件(在结束回勾之前,grep -L‘Autowire Request’‘Autowire Request’‘),那么我仍然会得到其余的错误。尽管如此,修复这些问题也是件好事。
发布于 2011-07-08 23:54:09
请参阅附于以下各点的贴片:
http://codehaus.markmail.org/thread/xuyzbe7aigitj5vj
https://stackoverflow.com/questions/6540842
复制相似问题