Search code examples
mavenrpcwsdl2java

Generating java from rpc wsdl


I have a pom which generates some java code from an RPC wsdl. The problem is that the code is never generated.

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
  <sourceDirectory>src/main/resources</sourceDirectory>
  <outputDirectory>${project.build.directory}/generated/rpc</outputDirectory>
  <packageSpace>com.company.wsdl</packageSpace>
  <testCases>false</testCases>
  <serverSide>true</serverSide>
  <subPackageByFileName>false</subPackageByFileName>
</configuration>
<executions>
  <execution>
    <goals>
      <goal>wsdl2java</goal>
    </goals>
  </execution>
</executions>
</plugin>

Any ideas as to why this isnt generating the java code?


Solution

  • After taken a look into your pom I realized your problem. It's not related to calling mvn its based on the configuration you made.

    You have configured the axistools-maven-plugin in the pluginManagement area. In this case you need to do this in the build area like this:

    <build>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>axistools-maven-plugin</artifactId>
          <version>1.4</version>
          <configuration>
           ..
          </configuration>
          <executions>
            <execution>
              <goals>
               <goal>wsdl2java</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
      ...
    </build>
    

    instead of:

    <build>
     <pluginManagement>
       <plugins>
        ...
      </plugins>
     </pluginManagement>
      ...
    </build>
    

    If you configure it correctly you can use mvn clean package or mvn clean install instead of calling mvn axistools:wsdl2java ...