我在使用jaxb2-maven-plugin时遇到了这个问题。我发现了一个相关的jira问题 maven-jabx2-plugin - https://java.net/projects/maven-jaxb2-plugin/lists/issues/archive/2014-03/message/0
根据这个问题,Stephan202建议使用属性maven插件,它像魅力一样工作。这是他帖子中的示例代码 -
<plugin>
<!-- We use this plugin to ensure that our usage of the
maven-jaxb2-plugin is JDK 8 compatible in absence of a fix
for https://java.net/jira/browse/MAVEN_JAXB2_PLUGIN-80. -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<id>set-additional-system-properties</id>
<goals>
<goal>set-system-properties</goal>
</goals>
</execution>
</executions>
<configuration>
<properties>
<property>
<name>javax.xml.accessExternalSchema</name>
<value>file,http</value>
</property>
</properties>
</configuration>
</plugin>