【maven install报错】Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.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
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值