解決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>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM