當maven項目里面有用到JDK內部的一些類或者接口的時候,用maven編譯一般會出現如下錯誤:
程序包:com.sun.xml.internal.bind.marshaller.CharacterEscapeHandler不存在。
解決方法如下:
添加maven-compiler-plugin插件,並且配置compilerArguments
如:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<arg>-XDignore.symbol.file</arg>
</compilerArgs>
<fork>true</fork>
</configuration>
</plugin>