2013-07-08 6 views
0

나는 wsdl 파일에서 클래스를 생성하기 위해 maven-jaxb2-plugin을 사용합니다. 내 wsdl fila에는 여러 스키마 항목이 있지만 하나만 있으면됩니다. 그래서 어떤 쉐마를 생성하고 싶은지 지정할 수 있습니다. 어쩌면 pom.xml 또는 xjb 바인딩 파일에 있습니까? 내 pop.xmlmaven-jaxb2-plugin 구성 :wsdl에서 하나의 스키마 만 생성하도록 Jaxb 플러그인을 지정하는 방법

<plugin> 
    <groupId>org.jvnet.jaxb2.maven2</groupId> 
    <artifactId>maven-jaxb2-plugin</artifactId> 
    <version>0.8.0</version> 
    <executions> 
     <execution> 
      <id>some_id</id> 
      <goals> 
       <goal>generate</goal> 
      </goals> 
      <configuration> 
       <schemaLanguage>WSDL</schemaLanguage> 
       <schemaDirectory>${basedir}/src/main/resources/wsdl/</schemaDirectory> 
       <schemaIncludes> 
        <include>*.wsdl</include> 
       </schemaIncludes> 
       <bindingIncludes> 
        <include>binding.xjb</include> // is 
       </bindingIncludes> 
       <generatePackage>my.custom.package</generatePackage> --> 
       <generateDirectory>target/generated-sources/jaxb</generateDirectory> 
      </configuration> 
    </execution> 

wsdl 파일은 다음과 같습니다 :

<?xml version="1.0" encoding="utf-8"?>  
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" ... other namespaces>  
    <types>  
    <xs:schema targetNamespace="http://www.custom.se/webservices/" elementFormDefault="qualified" attributeFormDefault="unqualified"  xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
     <xs:element name="Elem"> 
     <xs:complexType> 
      <xs:sequence> 
      <xs:element name="SeqNo" type="xs:string"/> 
      <xs:element name="Method" type="xs:string"/> 
      <xs:element name="Id" type="xs:string"/> 
      <xs:element name="UserId" type="xs:string"/> 
      <xs:element name="ResultCode" type="xs:string"/> 
      </xs:sequence> 
     </xs:complexType> 
     </xs:element> 
    </xs:schema> 

    <xs:schema targetNamespace="http://www.custom.se/webservices/publishing/"> 
    .... 
    </xs:shema> 

    <xs:schema targetNamespace="http://www.custom.se/webservices/smth/"> 
    .... 
    </xs:shema> 

    .... 

내가 어떤 도움을 주셔서 감사합니다.

답변

0

결국 달성하고자하는 것은 무엇입니까? jaxb 플러그인을 사용하고 jaxws 플러그인을 사용하지 않으므로 WSDL 구문에서 생성 된 Java 코드에 관심이 없다고 가정합니다. 따라서 목표는 생성 된 jar에서 생성 된 클래스의 수를 최소화하는 것입니다.

글쎄,이 경우 가장 쉬운 해결책은 모두를 생성 한 다음 선택적으로 컴파일 (또는 패키지화)하는 것입니다.