pom.xml中有多个wsdl2java目标

时间:2014-12-30 22:29:12

标签: java maven

我的pom.xml中需要两个wsdl2java目标,我希望将java文件写入两个不同的文件夹。有人可以告诉我该怎么办?我目前在我的pom.xml中有以下内容,我看到它只适用于第一个wsdl2java目标,但不是第二个。

   <build>
  <plugins>
     <plugin>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-codegen-plugin</artifactId>
        <executions>
           <execution>
              <id>generate-sources</id>
              <phase>generate-sources</phase>
              <configuration>
                 <sourceRoot>target/generated-sources/test/java</sourceRoot>
                 <wsdlOptions>
                    <wsdlOption>
                       <wsdl>src/main/resources/wsdl/test/GetInfo.wsdl</wsdl>
                       <extraargs>
                          <extraarg>-server</extraarg>
                          <extraarg>-client</extraarg>
                          <extraarg>-impl</extraarg>
                          <extraarg>-verbose</extraarg>
                       </extraargs>
                       <frontEnd>jaxws21</frontEnd>
                       <faultSerialVersionUID>1</faultSerialVersionUID>
                    </wsdlOption>
                 </wsdlOptions>
              </configuration>
              <goals>
                 <goal>wsdl2java</goal>
              </goals>
           </execution>
        </executions>
     </plugin>
     <plugin>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-codegen-plugin</artifactId>
        <executions>
           <execution>
              <id>generate-sources</id>
              <phase>generate-sources</phase>
              <configuration>
                 <sourceRoot>target/generated-sources/testOne/java</sourceRoot>
                 <wsdlOptions>
                    <wsdlOption>
                       <wsdl>src/main/resources/wsdl/testOne/CustomerDetails.wsdl</wsdl>
                       <extraargs>
                          <extraarg>-server</extraarg>
                          <extraarg>-client</extraarg>
                          <extraarg>-impl</extraarg>
                          <extraarg>-verbose</extraarg>
                       </extraargs>
                       <frontEnd>jaxws21</frontEnd>
                       <faultSerialVersionUID>1</faultSerialVersionUID>
                    </wsdlOption>
                 </wsdlOptions>
              </configuration>
              <goals>
                 <goal>wsdl2java</goal>
              </goals>
           </execution>
        </executions>
     </plugin>
  </plugins>

请告知。

1 个答案:

答案 0 :(得分:1)

创建两个different build profile并调用mvn两次,一次针对两个配置文件,或尝试使用不同配置执行多次as suggested here