解决maven 引用JDK内部类编译错误 程序包:com.sun.xml.internal.bind.marshaller.CharacterEscapeHandler不存在

当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>
原文地址:https://www.cnblogs.com/songpingyi/p/9707966.html