报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile

楚灿
2023-12-01

问题:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project ssm_web: Compilation failure: Compilation failure: 
[ERROR] /D:/JAVA/IdeaProject/basic-code/heima_ssm/ssm/ssm_web/src/main/java/cn/ziwei/controller/ProductController.java:[5,23] �����cn.ziwei.domain������
[ERROR] /D:/JAVA/IdeaProject/basic-code/heima_ssm/ssm/ssm_web/src/main/java/cn/ziwei/controller/ProductController.java:[6,24] �����cn.ziwei.service������
[ERROR] /D:/JAVA/IdeaProject/basic-code/heima_ssm/ssm/ssm_web/src/main/java/cn/ziwei/controller/ProductController.java:[19,13] �Ҳ�������
[ERROR]   ����:   �� IProductService
[ERROR]   �: �� cn.ziwei.controller.ProductController
[ERROR] /D:/JAVA/IdeaProject/basic-code/heima_ssm/ssm/ssm_web/src/main/java/cn/ziwei/controller/ProductController.java:[24,14] �Ҳ�������
[ERROR]   ����:   �� Product
[ERROR]   �: �� cn.ziwei.controller.ProductController
[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.

打包时发现错误

原因:
maven父子项目,运行ssm_web项目时,由于要依赖ssm_service,ssm_dao,等包,而这包没有被打包,所以报错

注意:要运行父项目时,也是如此,要将子项目打包后,父项目才能运行
注意:父项目的打包方式通常为pom,子项目的打包方式通常为jar

解决方法,从底而上,依次打包即可

 类似资料: