3 Replies Latest reply on Mar 28, 2017 10:53 PM by sarada ch

    How to configure wsconsume maven plugin?

    Paul Baker Apprentice

      Is there a step by step tutorial that illustrates how to configure maven (settings.xml / pom.xml) running in eclipse helios to be able to use wsconsume plugin (maven-jaxws-tools-plugin).

       

      My Environment is:

      Windows 7 x64

      JBoss AS6 Final

      Eclipse Helios

       

      I have looked at a number of sites (doco, forums, etc)

       

      http://community.jboss.org/wiki/JBossWS-Wsconsume

       

      pom examples:

      http://anonsvn.jboss.org/repos/jbossws/projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/

       

      But I am still having trouble.  I am not a maven expert and I some of the sites make some assumptions about the maven knowledge level (I am new to Maven).

       

      I already have a service deployed and I am able to generate the client proxies using wsconsume from the command line (no problem).

       

      wsconsume -k --verbose --output=myfolder --package com.myserviceproxy http://localhost:8080/MySampleService?wsdl

       

      Some of my general problems deal with accessing the plugin in the correct repository.   The samples that I have seen don't specify a respository and it may be that the settings.xml has this information (but this is not shown).

       

      Below is my latest pom.xml. The error that I am currently getting in eclipse is:

       

      Could not calculate build plan: Could not find artifact org.jboss.ws.plugins:maven-jaxws-tools-plugin:pom:1.0.1.GA in central (http://repo1.maven.org/maven2) ahm565 Unknown  Maven Problem

       

       

      From the error message it looks as if http://repo1.maven.org/maven2 is being used as the repository and from the documentation that I have seen the plugin will not be there.. It will be in https://repository.jboss.org/nexus/content/groups/public

       

      Also once I get this pom correct what goal do I use when configuring the Maven Build?

      I currently have: org.jboss.ws.plugins:maven-jaxws-tools-plugin:1.0.1.GA:wsconsume

       

      Any help would be very much welcome and thanks in advance.  In responding please consider that my Maven knowledge is very limited.

       

      Current POM:

       

      <project 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.org/xsd/maven-4.0.0.xsd">
       <modelVersion>4.0.0</modelVersion>
       <groupId>com.myproject</groupId>
       <artifactId>sample</artifactId>
       <version>0.0.1-SNAPSHOT</version>
       <packaging>war</packaging>
       <name>SAMPLE</name>
       <description>My Sample Client Project</description>
       <repositories>
        <repository>
         <id>JBOSS</id>
         <name>JBoss Repository</name>
         <url>https://repository.jboss.org/nexus/content/groups/public/</url>
        </repository>
       </repositories>
       <build>
        <pluginManagement>
        </pluginManagement>
        <plugins>
         <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>2.1.1</version>
          <configuration>
           <warSourceDirectory>WebContent</warSourceDirectory>
           <webXml>WebContent/WEB-INF/web.xml</webXml>
          </configuration>
         </plugin>
         <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>jboss-maven-plugin</artifactId>
          <version>1.5.0</version>
          <configuration>
           <jbossHome>C:\JBoss\jboss-6.0.0.Final\</jbossHome>
           <serverName>default</serverName>
           <fileName>${project.basedir}/target/${project.build.finalName}.war</fileName>
          </configuration>
         </plugin>
         <plugin>
          <groupId>org.jboss.ws.plugins</groupId>
          <artifactId>maven-jaxws-tools-plugin</artifactId>
          <version>1.0.1.GA</version>
          <configuration>
           <wsdls>
            <wsdl>http://localhost:8080/MySampleService?wsdl</wsdl>
           </wsdls>
           <targetPackage>com.mysample.service.proxy</targetPackage>
           <extension>true</extension>
           <verbose>true</verbose>
           <goalPrefix>wsconsume</goalPrefix>
          </configuration>
          <executions>
           <execution>
            <goals>
             <goal>wsconsume</goal>
            </goals>
           </execution>
          </executions>
         </plugin>
        </plugins>
       </build>
       <dependencies>
        <dependency>
         <groupId>org.jboss.ws.native</groupId>
         <artifactId>jbossws-native-client</artifactId>
         <version>3.4.1.GA</version>
        </dependency>
        <dependency>
         <groupId>org.jboss</groupId>
         <artifactId>jbossxb</artifactId>
         <version>2.0.1.GA</version>
        </dependency>
       </dependencies>
      </project>