javamavenjaxbjaxb2-maven-plugin

jaxb2-maven-plugin not generating sources from wsdl


I have the following configuration for jaxb2-maven-plugin version 2.4

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxb2-maven-plugin</artifactId>
    <version>2.4</version>
    <executions>
        <execution>
            <id>xjc</id>
            <goals>
                <goal>xjc</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <sourceType>wsdl</sourceType>
        <sources>
            <source>src/main/resources/wsdl/osg_data_sync_service_1_0.wsdl</source>
            <source>src/main/resources/wsdl/parlayx_sms_notification_service_2_2.wsdl</source>
        </sources>
        <outputDirectory>${project.basedir}/src/main/generated</outputDirectory>
        <clearOutputDir>false</clearOutputDir>
    </configuration>
</plugin>

But when i run mvn jaxb2:xjc, no classes are generated.

What could I be overlooking?

I have pasted one of the wsdl here

EDIT

As it was mentioned that this might be a possible duplicate, I downgraded the plugin to version 1.6 and changed configuration to the following and still no classes generated.

<configuration>
    <wsdl>true</wsdl>
    <xmlschema>false</xmlschema
    <schemaFiles>osg_data_sync_interface_1_0.wsdl,parlayx_sms_notification_interface_2_2.wsdl</schemaFiles>
    <schemaDirectory>src/main/resources/wsdl</schemaDirectory>
    <outputDirectory>${project.basedir}/src/main/generated</outputDirectory> 
</configuration>

Full pom here as site was complaining too much code

It finally works with version 1.6 after cleaning. Why does version 2.4 not work?


Solution

  • Finally got version 2.4 to work. I don't know exactly what the issue was but I was able to generate the classes by running mvn generate-sources instead of mvn jaxb2:xjc as suggested in the comments. I also had to run mvn clean first