Maven2 - wsdl2code plugin

2010-10-10  来源:本站原创  分类:Java  人气:200 

wsdl2code plug-in can automatically generate a specified axis WSDL file the client and server stub code, which reduces the write call to web service implementation and the amount of code. This eclipse-based plugin, but also based on maven2, today try maven2 to generate client code, the following steps of record:

1. To modify the project root directory of the pom.xml file, add the following plugin:

<plugin>
                <groupId>org.apache.axis2</groupId>
                <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
                <version>1.5.1</version>
                <executions>
                        <execution>
                                <id>wsdl2code</id>
                                <goals>
                                        <goal>wsdl2code</goal>
                                </goals>
                                <configuration>
                                        <packageName>com.wisdom.axis.services</packageName>
                                                <wsdlFile>src/main/wsdl/SimpleService.wsdl</wsdlFile>
                                                <databindingName>xmlbeans</databindingName>
                                </configuration>
                        </execution>
                </executions>
        </plugin>

Excuse, packageName: the client stub class generated by the use of the package name, wsdlFile: wsdl file which specifies the path, databindingName: Specifies the data binding framework, used to generate client code. The default is adb, here in the xmlbeans xmlbeans apache-based framework for parsing wsdl file. If you want to build server-side code, you need configuration below generateServerSide and generateServerSideInterface set true. By default, they are false.

2. Join dependencies:

<dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2</artifactId>
        <version>1.5.1</version>
        <type>pom</type>
        <scope>compile</scope>
    </dependency>

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

3. Set, you can enter the command line to the directory where the pom file, run the command: mvn axis2-wsdl2code: wsdl2code. Here you may encounter the following exception:

[ERROR]BUILD ERROR
------------------------------------------------------------------------
Internal error in the plugin manager executing goal
'org.apache.axis2:axis2-wsdl2code-maven-plugin:1.4.1:wsdl2code': Unable to
find the mojo
'org.apache.axis2:axis2-wsdl2code-maven-plugin:1.4.1:wsdl2code' in the
plugin 'org.apache.axis2:axis2-wsdl2code-maven-plugin'
org.apache.axis2.wsdl.codegen.CodeGenerationException
------------------------------------------------------------------------
For more information, run Maven with the -e switch
------------------------------------------------------------------------
Total time: 1 minute 58 seconds
Finished at: Wed Feb 10 14:37:26 PST 2010
Final Memory: 16M/41M

This should be a network problem, there is a temporary solution, that is, ~ \. M2 below to create a settings.xml file, and add the following to the mirrors:

<settings>
  <mirrors>

    <mirror>
      <id>java.net.2</id>
      <name>java.net Mirror of http://repo1.maven.org/maven2/</name>
      <url>http://download.java.net/maven/2/</url>
      <mirrorOf>java.net</mirrorOf>
    </mirror>

  </mirrors>
</settings>

Can refer to specific http://stackoverflow.com/questions/2206687/how-can-i-setup-dependencies-for-axis2-axiom-on-maven2

Please ensure that the above settings will delete all the files under ~/.m2/repository/org/apache/axis2 out, and then run mvn axis2-wsdl2code: wsdl2code

Client code found in / target/generated-sources/axis2/wsdl2code/src / com / wisdom / axis / services /.

相关文章
  • Maven2 - wsdl2code plugin 2010-10-10

    wsdl2code plug-in can automatically generate a specified axis WSDL file the client and server stub code, which reduces the write call to web service implementation and the amount of code. This eclipse-based plugin, but also based on maven2, today try

  • Maven2 and the combined use of Eclipse 2010-10-09

    The concept has been struggling for Maven2 fuzzy and not related project experience, so its research is always stop parking place. Previous studies have not recorded, leading each time to re-study again, this must be a good record of it. Maven2 defau

  • eclipse 3.6.1 install maven plug-in solution failed 2010-10-21

    A, eclipse 3.6.1 Download [eclipse-jee-helios-SR1-win32.zip] http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/heliossr1 Second, the plug-in Address 1, gef plug-in Address: http://download.eclipse.org/tools/gef/updates/interim/

  • Nexs to build entry-PW 2010-11-25

    Maven2 has a lot of attention to day, and gradually felt this powerful project management tools, the most direct experience is no need for the introduction of jar package to worry about it (a lot when we download the jar from the official website pac

  • eclipse install maven and TestNG 2011-05-04

    To install this Maven2 Eclipse plugin, Open Eclipse, then choose Help | Install New Software. Add ... -> Name: m2eclipse Localhost: http://m2eclipse.sonatype.org/sites/m2e Then choose this m2eclipse site and the available packages on that site will b

  • Nexus to build entry-PW 2009-04-27

    Maven2 has a lot of attention to day, and gradually felt a powerful project management tools, the most direct experience is no longer a headache for the introduction of jar files (from the official website a lot when we download jar package, and then

  • Maven2 plugin development brief steps 2010-06-17

    One, run: mvn archetype: create-DgroupId =* -DartifactId =* -DarchetypeGroupId = org.apache.maven.archetypes -DarchetypeArtifactId = maven-archetype-mojo Creating plugin project. Define their own group and actifact the ID, the latter two use the defa

  • Writing custom Maven2 plugin 2010-06-18

    from: http://jwu.javaeye.com/blog/612944 First, create a plug-in project > Mvn archetype: create-DgroupId = org.sonatype.mavenbook.plugins-DartifactId = first-maven-plugin-DarchetypeGroupId = org.apache.maven.archetypes-DarchetypeArtifactId = maven-a

  • The report used Maven2 plugin 2010-07-20

    1, findbugs-maven-plugin http://mojo.codehaus.org/findbugs-maven-plugin/ FindBugs looks for bugs in Java programs. It is based on the concept of bug patterns. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven

  • Writing a custom Maven2 plugin 2010-01-07

    First, create a plug-in project > Mvn archetype: create-DgroupId = org.sonatype.mavenbook.plugins-DartifactId = first-maven-plugin-DarchetypeGroupId = org.apache.maven.archetypes-DarchetypeArtifactId = maven-archetype-mojo automatically to the remote

  • The common plugin Maven2 build 2010-07-20

    1, maven-compiler-plugin 2, maven-eclipse-plugin 3, maven-source-plugin 4, more

  • The build common plugin Maven2 2010-07-20

    1, maven-compiler-plugin 2, maven-eclipse-plugin 3, maven-source-plugin 4, more

  • Maven2 integration to build a J2EE project 2009-04-21

    1. Background Maven2 basic principle is very simple, the use of remote storage and local storage, as well as pom (project object model). Xml, will be defined in pom.xml files from remote storage jar download to a local warehouse, all applications usi

  • Use maven2 configuration organize a team of ... 2009-04-25

    For the team, the establishment of a unified development environment is a necessity maven well assist the establishment of a unified environment. Here's how to introduce more effective unified configuration. Preparation work: Download the necessary s

  • Maven2 Learning Summary (1) 2010-03-29

    Now your looking at Maven2 important things that the conceptual record it, add and improve the availability and then:) 1: The Project Object Model 1.POM definition: The POM is where a project's identity and structure are declared, builds are configur

  • Maven2 build project using JDK1.4 2010-03-29

    Maven2 build project using JDK1.4 setting.xml <settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.o

  • maven2 use Xiangjie 2010-03-29

    http://www.cnblogs.com/flyingzqx/archive/2009/12/03/1616201.html maven2 start I believe everyone maven1 already very familiar with the specific maven can do, is not explained in detail. Personally feel that the open-source projects using maven or rel

  • [Change] maven2 full manual 2010-03-29

    maven2 start I believe everyone maven1 already very familiar with the specific maven can do, is not explained in detail. Personally feel that the open-source projects using maven or relatively more within the company, it is not clear. I've used the c

  • maven2 reported that cannot be cast to javax.servlet.Filter error solution 2010-03-30

    Use tomcat plugin in maven2 time, cannot be cast to javax.servlet.Filter reported problems Using tomcat plugin in maven2 start web application, in the pom.xml to add the following configuration information: <project> ... <build> <! - To def

  • Appfuse2 created using the maven2 project native2ascii related issues 2010-03-31

    Appfuse2 started using Maven2 as build tool. Create the following exception occurs after the completion. java.lang.ClassNotFoundException: sun.tools.native2ascii.Main The Internet to find the same problem, but did not find relevant solutions. POM gen