How to specify multiple WSDLs for generating JAX-WS artifacts using CXF’s Maven plugin for wsdl2java (cxf-codegen-plugin)?


<plugin>
	<groupId>org.apache.cxf</groupId>
	<artifactId>cxf-codegen-plugin</artifactId>
	<version>${cxf.version}</version>
	<executions>
		<execution>
			<id>generate-sources</id>
			<phase>generate-sources</phase>
			<configuration>
				<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
				<wsdlOptions>
					<!-- for myService1.wsdl -->
					<wsdlOption>
						<wsdl>${basedir}/src/main/wsdl/myService1.wsdl</wsdl>
					</wsdlOption>
					<!-- for myService2.wsdl -->
					<wsdlOption>
						<wsdl>${basedir}/src/main/wsdl/myService2.wsdl</wsdl>
					</wsdlOption>
					. . .
				</wsdlOptions>
			</configuration>
			<goals>
				<goal>wsdl2java</goal>
			</goals>
		</execution>
	</executions>
</plugin>

Each element corresponds to a WSDL for which we need to generate artifcats.

About these ads

About this entry