栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

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

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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  为文件存放目录,可参考图一。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/462468.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号