当我尝试添加JAXB2插件时,在<exception>
行上收到“无法处理架构文件”错误。
pom.xml
<plugins>
<!-- JAXB2 Maven Plugin -->
<!-- XSD Source Folder -->
<!-- Java Class Source Folder -->
<!-- clear folder -> false -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<clearOutputDir>false</clearOutputDir>
</configuration>
</plugin>
</plugins>
错误截图:
答案 0 :(得分:0)
我遇到类似的问题,只是要确保xsd文件具有
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
</xsd:schema>
不是
<schema xmlns="http://www.w3.org/2001/XMLSchema">
</schema>`