2007-10-11

Maven Axis2 XMLBeans WSDL2Code

Just in case you're trying to generate classes from a WSDL-file using the latest Axis 2 (1.3) and XMLBeans databinding: You really should use this axis2-wsdl2code-maven-plugin and none else:

http://repo1.maven.org/maven2/org/apache/axis2/axis2-wsdl2code-maven-plugin/1.3/

It differs from the version stated on the Apache Tools-WebSite in the groupId:

Wrong is this: <groupId>org.apache.axis2.maven2</groupId>

What you want is this: <groupId>org.apache.axis2</groupId> and an additional <version>1.3</version>, so it all comes down to:

             <plugin>
                <groupId>org.apache.axis2</groupId>
                <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsdl2code</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <packageName>
                        [YOUR PACKAGE HERE]
                    </packageName>
                    <databindingName>xmlbeans</databindingName>
                    <wsdlFile>src/main/axis2/[YOURS HERE]</wsdlFile>
                    </configuration>
            </plugin>

It has so much bugs less and works for our fairly complex WSDL circus. You don't even need to set up XMLBeans on its own, adding it as a dependency seems to "just work".

Oh, in case you didn't notice, XMLBeans has moved to Apache sometime now. Logically, the groupId needed to change also. Maven prints an INFO line, that it has been relocated, but to get the current stuff (version 2.3) better add this to the pom.xml:

<dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>2.3.0</version>
</dependency>

It's so easy, I wonder what took me all day…

Update: Found the bug: Axis2 bug tracking AXIS2-3257.

1 Kommentar:

Jochen Wiedmann hat gesagt…

And now, guess what project has caused the creation of this "none else" plugin? :-)

Btw, the bug in the docs is because the group *was* ...maven2 initially, For unknown reasons, someone moved it without updating the docs.