내 Ant 빌드 파일에 의 Apache CXF을 사용하여 WSDL에서 Java 코드를 생성하고 싶습니다. 종속성은 Ivy을 사용하여 해결됩니다. 나는 항상 다음과 같은 오류 메시지가 나타납니다 :CXF WSDLToJava의이 Ant/Ivy 통합이 작동하지 않는 이유는 무엇입니까?
WSDLToJava Error: Could not find jaxb databinding within classpath
저는 설치가없고 아이비를 사용하여 저를 대신하고 싶습니다. 다음은 Ant 빌드 파일의 일부입니다.
<target name="generate" depends="init">
<ivy:retrieve conf="build"/>
<mkdir dir="${basedir}/target/generated"/>
<ivy:cachepath pathid="build-classpath" conf="build"/>
<java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
<arg value="-d"/>
<arg value="${basedir}/target/generated"/>
<arg value="-client"/>
<arg value="${basedir}/src/schema/MyWebService.wsdl"/>
<classpath refid="build-classpath"/>
</java>
</target>
Java 6, Ant 1.8, Ivy 2.2.0 ant CXF 2.2.12를 사용합니다. Ivy 모듈에서 다음을 구성했습니다.
<configurations>
<conf name="build" visibility="private"/>
...
</configurations>
<dependencies defaultconfmapping="*->default">
<dependency org="org.apache.cxf" name="cxf-tools-wsdlto-frontend-jaxws" rev="2.2.12" conf="build"/>
<dependency org="org.apache.cxf" name="cxf-rt-databinding-jaxb" rev="2.2.12" conf="build"/>
...
</dependencies>
어디에서 문제가 발생합니까? 아마도 의존성이 누락되었지만 어느 것이 있습니까? Ivy가 없으면 Ant 통합은 CXF 설치의 모든 병과 함께 클래스 경로를 사용합니다. 그렇게하면 작동합니다. 나는 다음을 참조 빌드의 출력에서
:
generate (2s)
[generate] ivy:retrieve (1s)
[ivy:retrieve] :: resolving dependencies :: me#mine;1.0
[ivy:retrieve] confs: [build]
[ivy:retrieve] found org.apache.cxf#cxf-tools-wsdlto-frontend-jaxws;2.2.12 in public
[ivy:retrieve] found org.apache.cxf#cxf-tools-common;2.2.12 in public
[ivy:retrieve] found oro#oro;2.0.8 in public
[ivy:retrieve] found wsdl4j#wsdl4j;1.6.2 in public
[ivy:retrieve] found com.sun.xml.bind#jaxb-xjc;2.1.13 in public
[ivy:retrieve] found com.sun.xml.bind#jaxb-impl;2.1.13 in public
[ivy:retrieve] found javax.xml.bind#jaxb-api;2.1 in public
[ivy:retrieve] found javax.xml.stream#stax-api;1.0-2 in public
[ivy:retrieve] found javax.xml.soap#saaj-api;1.3 in public
[ivy:retrieve] found org.apache.cxf#cxf-api;2.2.12 in public
[ivy:retrieve] found org.apache.cxf#cxf-common-utilities;2.2.12 in public
... (many more)
[ivy:retrieve] :: retrieving :: me#mine
[ivy:retrieve] confs: [build]
[ivy:retrieve] 32 artifacts copied, 28 already retrieved (8959kB/38ms)
[generate] mkdir
[mkdir] Created dir: /tmp/target/generated
[generate] java (1s)
[java] WSDLToJava Error: Could not find jaxb databinding within classpath
감사합니다. 단지'cxf-tools-wsdlto-frontend-jaxws'와'cxf-tools-wsdlto-databinding-jaxb' 만 있으면됩니다. –