我正在嘗試使用插件jaxb2-maven-plugin
從wsdl創建Java類。如何在jaxb2-maven-plugin version 2中從WSDL創建類java?
我與1.5版得到它和下面的代碼(鏈接:Generate classes with jaxb2-maven-plugin from WSDL):
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- Package to store the generated file -->
<packageName>com.example.demo.wsdl</packageName>
<!-- Treat the input as WSDL -->
<wsdl>true</wsdl>
<!-- Input is not XML schema -->
<xmlschema>false</xmlschema>
<!-- The WSDL file that you saved earlier -->
<schemaFiles>horarios.wsdl</schemaFiles>
<!-- The location of the WSDL file -->
<schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory>
<!-- The output directory to store the generated Java files -->
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<!-- Don't clear output directory on each run -->
<clearOutputDir>false</clearOutputDir>
</configuration>
</plugin>
但是,當我更改爲2.3.1,我得到以下錯誤:
Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:2.3.1:xjc (xjc) on project demo: MojoExecutionException: NoSchemasException -> [Help 1]
有人知道如何使用WSDL文件與這個新的插件版本?
相關的更多信息: https://stackoverflow.com/questions/35242941/jaxb-maven-plugin-not-generating-classes –