在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>