eclipse 使用maven打包 包含非java文件时报错

eclipse 使用maven打包 包含非java文件时报错,第1张

eclipse 使用maven打包 包含非java文件时报错 原因:

在代码中包含了字体库文件 如图:

 当含有非java文件打包时会,打包失败 报错

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.2.RELEASE:repackage (default) on project wms-weighing: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.3.2.RELEASE:repackage failed: Unable to rename 'D:ideaWorkOnewms-weighingtargetwms-weighing-0.0.1-SNAPSHOT.war' to 'D:ideaWorkOnewms-weighingtargetwms-weighing-0.0.1-SNAPSHOT.war.original' -> [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/PluginExecutionException
尝试:

删除 SIMKAI.TTF该文件后打包 ,成功了但是 war包中没有该字体库调用时 会导致中文无法加载,每次手动将字体库加入war中比较麻烦

解决办法:

需要在pom.xml配置文件中build节点的resources下增加一个resource,指定directory为src/main/java目录,然后配置include包含***.TTF compile

/src/main/java/com/weighbridge/util  为文件存放目录,可参考图一。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5437968.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-11
下一篇 2022-12-11

发表评论

登录后才能评论

评论列表(0条)

保存