【maven install报错】Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:

taotaoSSM 专栏收录该内容
2 篇文章 0 订阅

在SSM搭建好,写了一个简单的Controller之后,通过tomcat插件启动项目时启动失败,报错如下:

[INFO] Compiling 1 source file to D:\java\ideaworkspace\taotao\taotao-manager\taotao-manager-web\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /D:/java/ideaworkspace/taotao/taotao-manager/taotao-manager-web/src/main/java/com/taotao/controller/ItemController.java:[3,35] 程序包com.sun.org.glassfish.gmbal不存在
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] taotao-manager ..................................... SUCCESS [  1.303 s]
[INFO] taotao-manager-pojo ................................ SUCCESS [  2.930 s]
[INFO] taotao-manager-mapper .............................. SUCCESS [  0.411 s]
[INFO] taotao-manager-service ............................. SUCCESS [  0.380 s]
[INFO] taotao-manager-web ................................. FAILURE [  0.459 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.786 s
[INFO] Finished at: 2018-04-20T19:33:40+08:00
[INFO] Final Memory: 26M/208M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project taotao-manager-web: Compilation failure
[ERROR] /D:/java/ideaworkspace/taotao/taotao-manager/taotao-manager-web/src/main/java/com/taotao/controller/ItemController.java:[3,35] 程序包com.sun.org.glassfish.gmbal不存在
[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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :taotao-manager-web


Process finished with exit code 1

原因:java编译器插件提示少个包,在parent的porm.xml里的java编译器插件里加上下面几行导入即可

 
<!-- java编译插件 -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.7.0</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <encoding>UTF-8</encoding>
        <compilerArguments>
         <verbose />
         <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
        </compilerArguments>
    </configuration>
</plugin>


  • 1
    点赞
  • 1
    评论
  • 0
    收藏
  • 打赏
    打赏
  • 扫一扫,分享海报

©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页

打赏作者

smidaxb

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值