我试图为wsdl架构生成对象,然后在我的项目中使用它们。
我可以看到.java文件在generate-sources文件夹中正确生成,但它们在我的项目中不被视为源。
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.3</version>
<executions>
<execution>
<id>order-generate</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaLanguage>WSDL</schemaLanguage>
<generatePackage>orderService.wsdl</generatePackage>
<generateDirectory>${project.build.directory}/generated-sources/orderService</generateDirectory>
<schemas>
<schema>
<url>https://localhost/orderService_v2.1/AppOrderService?wsdl</url>
</schema>
</schemas>
<removeOldOutput>true</removeOldOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/orderService</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>