Delegate IDE build/run actions to maven 配置会影响程序运行吗?
背景
IDEA的build/run动作如果委托给了maven之后,会影响程序运行吗?
本文来介绍一下这个问题。答案是,可能会,如果pom.xml中配置的build有额外的执行动作,就会影响程序运行,甚至会导致运行失败。
看个配置
异常显示是自动打包vue项目的插件执行失败了,定位问题可能出在maveninstall操作上,为什么会执行mavenbuild呢,理论上只需要compile项目就可以了呀。
联想到上周和本周IDEA的配置差异,去掉此勾选项后,不再执行mavenbuild操作了,项目正常跑起来了。
后续
2020年8月18日,又看了另一个模块,在取消勾选“DelegateIDEbuild/runactionstomaven”配置后,它虽然是SpringBoot项目,但是没法运行,编译报错还是common中的类文件找不到。
对比了它的pom.xml和其他模块的,发现它配置了maven编译操作:
启示录
我们的项目使用SpringBoot做后端,Vue做前端,web端项目会配置一个exec-maven-plugin插件执行npminstall命令,将Vue项目打包到web的static目录下。但是这个Vue项目平时没有执行过,依赖的前端模块都没有安装。
当IDEA的build/run动作被委托给maven后,就会由maven执行pom.xml中的打包配置,最终在执行npminstallVueProject的时候,解决依赖失败,导致SpringBoot的项目的主函数启动失败了。
总结
到此这篇关于DelegateIDEbuild/runactionstomaven配置会影响程序运行吗?的文章就介绍到这了,更多相关DelegateIDEbuild/runactionstomaven配置内容请搜索毛票票以前的文章或继续浏览下面的相关文章希望大家以后多多支持毛票票!
声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:czq8825#qq.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。