开发者社区> 问答> 正文

maven打war包字符串过长的错误怎么解决??报错

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project rgStar: Compilation failure
[ERROR] /C:/vs/workspace_eclipse/rgStar/src/main/java/rg/contacts/filter/IptablesFilter.java:[85,38] 常量字符串过长
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

报错的那行代码很简单,就是:

String json=“很长很长的一个json字符串。。。。。。”;

同样的代码,在另一个非maven工程中就可以正常打包。或者在这个maven工程下,把字符串改的很短,也可以通过。

展开
收起
爱吃鱼的程序员 2020-06-08 10:52:33 1064 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    放到文件中,然后读取上来?

    后来直接使用项目右键->export导出war包就没事。

    2020-06-08 10:52:52
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载