3 Replies Latest reply on Sep 21, 2011 11:34 AM by peterj

    How to configure wsconsume with multiple wsdls and packages using maven

    pbaker01

      Is is possible to configure wsconsume with maven to generate client code for two different wsdsl and packages?

       

      When I execute the plugin (see below) using: org.jboss.ws.plugins:maven-jaxws-tools-plugin:1.0.1.GA:wsconsume

       

      I receive message:

       

      [INFO] No wsdl URL / file specified, nothing to do.

       

      What am I doing wrong.

      <?

      xml version="1.0" encoding="UTF-8"

      ?>

      <

      project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=

      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.eloadmaster</groupId

      >

      <artifactId>ahm565</artifactId

      >

      <version>0.0.1-SNAPSHOT</version

      >

      <packaging>war</packaging

      >

      <name>AHM565</name

      >

      <description>AHM565 Client Project</description

      >

       

      <repositories

      >

      <repository

      >

      <id>JBOSS</id

      >

      <name>JBoss Repository</name

      >

      <url>https://repository.jboss.org/nexus/content/groups/public/</url

      >

      </repository

      >

      </repositories

      >

       

      <pluginRepositories

      >

      <pluginRepository

      >

      <id>JBOSS</id

      >

      <name>JBoss Repository</name

      >

      <url>https://repository.jboss.org/nexus/content/groups/public/</url

      >

      </pluginRepository

      >

      </pluginRepositories

      >

       

      <build

      >

      <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

      >

      <executions

      >

      <execution

      >

      <id>MyFirstService</id

      >

      <goals

      >

      <goal>wsconsume</goal

      >

      </goals

      >

      <configuration

      >

      <wsdls

      >

      <wsdl>http://localhost:8080/MyFirstService?wsdl</wsdl

      >

      </wsdls

      >

      <targetPackage>com.mypackage.myfirstservice</targetPackage

      >

      <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory

      >

      <extension>true</extension

      >

      <verbose>true</verbose

      >

      <goalPrefix>wsconsume</goalPrefix

      >

      </configuration

      >

      </execution

      >

      <execution

      >

      <id>MySecondService</id

      >

      <goals

      >

      <goal>wsconsume</goal

      >

      </goals

      >

      <configuration

      >

      <wsdls

      >

      <wsdl>http://localhost:8080/MySecondService?wsdl</wsdl

      >

      </wsdls

      >

      <targetPackage>com.mypackage.mysecondservice</targetPackage

      >

      <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory

      >

      <extension>true</extension

      >

      <verbose>true</verbose

      >

      <goalPrefix>wsconsume</goalPrefix

      >

      </configuration

      >

      </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

      >

       

      Thank you in adavnce.

       

      Paul

        • 1. Re: How to configure wsconsume with multiple wsdls and packages using maven
          peterj

          This is the correct way to invoke a plugin twice using different configurations for each run. Though you might want to also add in the sourceDirectory attribute (see http://community.jboss.org/wiki/JBossWS-wsconsume#Maven_Plugin) because perhaps the plugin might clean thedirectory before generating sources. You should be getting two instances of the jaxws-tools plugin, each configured differently.

           

          You might try running mvn with -X. Make sure you redirect to a file because you get a lot of output. Look in the output for the Build Plan report. That report will detail each plugin to be run and the configuration for the plugin.

           

          If that doesn't help, you might have to debug the plugin itself.

          • 2. Re: How to configure wsconsume with multiple wsdls and packages using maven
            pbaker01

            Hi Peter,

            Thanks (again)...

            I had been trying to run the wsconsume goal seperately but when I ran maven install then both wsdls were processed....

            • 3. Re: How to configure wsconsume with multiple wsdls and packages using maven
              peterj

              If you run Maven specifying a specific plugin goal on the command line, it runs just that goal, and only once. To get it to run the two goals defined in the pom.xml, you must run Maven specifying the phase the goals are tired to (or a later phase). You can see this by noticing the differences in the Build Path when you add the -X option.

               

              Also, if you specify multiple goals and phases on the comand line, Maven runs through them in the order in which they appeared on the command line. For each phase, it performs all of the lifecycle phases up to the phase specified.

              1 of 1 people found this helpful