Search code examples
javaxsdjaxbwsdl

I am facing this iisue while generating java classes from wsdl and xsd


I am facing this issue while generating java classes from wsdl and xsd.pls suggest.

  1. Error message: "Execution schema1-generate of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.14.0:generate failed"
  2. What has been tried ? Eclipse installed jre set to jdk
  3. Tried changing the jaxb plugin from org.jvnet.jaxb2.maven2 to org.codehaus.moj but still the same
  4. I have multiple wsdls and they have xsds . Below is my pom file configuration :
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<!-- <version>0.13.2</version> -->              
<executions>
<execution> 
    <id>schema1-generate</id> 
    <goals> 
        <goal>generate</goal> 
    </goals>  
    <configuration> 
        <schemaLanguage>WSDL</schemaLanguage> 
        <wsdl>true</wsdl> 
        <forceRegenerate>true</forceRegenerate> 
        <schemaDirectory>src/main/wsdl</schemaDirectory> 
        <schemaIncludes>
            <include>xyz.wsdl</include> 
        </schemaIncludes> 
        <generateDirectory>src/main/java</generateDirectory> 
        <generatePackage>package_name</generatePackage> 
        <clearOutputDir>false</clearOutputDir> 
    </configuration>             
</execution>
                
                

Solution

  • Finally the below worked for me:

        <dependency>
        <groupId>org.jvnet.jaxb2_commons</groupId>
        <artifactId>jaxb2-basics-runtime</artifactId>
        <version>0.9.4</version>
    </dependency>
    <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <!-- <version>0.13.2</version> -->
    <execution>
          <id>AnyId-schemas</id>
          <goals>
          <goal>generate</goal>
          </goals>
           <configuration>
           <schemaLanguage>XMLSCHEMA</schemaLanguage>
           <forceRegenerate>true</forceRegenerate>
           <generateDirectory>src/main/java</generateDirectory>
           <generatePackage>packageName</generatePackage>
           <schemaDirectory>src/main/wsdl</schemaDirectory>
           <schemaIncludes>
           <include>sourceOf the xsd</include>
           </schemaIncludes>
           </configuration>
      </execution>