打包出错

来源:4-3 运行SpringBoot应用【执行要高效】

Shiaguangxiang

2020-02-18

创建工程,然后远行正常,打包就抱错了
----------------------< com.example.demo1:demo1 >-----------------------
[INFO] Building demo1 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] — maven-clean-plugin:3.1.0:clean (default-clean) @ demo1 —
[INFO] Deleting /Users/sergei/code/demo1/target
[INFO]
[INFO] — maven-resources-plugin:3.1.0:resources (default-resources) @ demo1 —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] — maven-compiler-plugin:3.8.0:compile (default-compile) @ demo1 —
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/sergei/code/demo1/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/sergei/code/demo1/src/main/java/com/example/demo1/demo1/Demo1Application.java:[3,32] 程序包org.springframework.boot不存在
[ERROR] /Users/sergei/code/demo1/src/main/java/com/example/demo1/demo1/Demo1Application.java:[4,46] 程序包org.springframework.boot.autoconfigure不存在
[ERROR] /Users/sergei/code/demo1/src/main/java/com/example/demo1/demo1/Demo1Application.java:[6,2] 找不到符号
符号: 类 SpringBootApplication
[ERROR] /Users/sergei/code/demo1/src/main/java/com/example/demo1/demo1/Demo1Application.java:[10,9] 找不到符号
符号: 变量 SpringApplication
位置: 类 com.example.demo1.demo1.Demo1Application
[INFO] 4 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.366 s
[INFO] Finished at: 2020-02-18T13:57:59+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project demo1: Compilation failure: Compilation failure:
[ERROR] /Users/sergei/code/demo1/src/main/java/com/example/demo1/demo1/Demo1Application.java:[3,32] 程序包org.springframework.boot不存在
[ERROR] /Users/sergei/code/demo1/src/main/java/com/example/demo1/demo1/Demo1Application.java:[4,46] 程序包org.springframework.boot.autoconfigure不存在
[ERROR] /Users/sergei/code/demo1/src/main/java/com/example/demo1/demo1/Demo1Application.java:[6,2] 找不到符号
[ERROR] 符号: 类 SpringBootApplication
[ERROR] /Users/sergei/code/demo1/src/main/java/com/example/demo1/demo1/Demo1Application.java:[10,9] 找不到符号
[ERROR] 符号: 变量 SpringApplication
[ERROR] 位置: 类 com.example.demo1.demo1.Demo1Application
[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
SergeideMBP:demo1 sergei$

写回答

1回答

廖师兄

2020-02-19

这是依赖没下载好。

  1. 删掉settings.xml

  2. 使用我的课程源码,打包试试。

0
0

实战支付+电商双系统 玩转Java技术栈

花一份课的价,收获:双系统实战+坐拥20K+粉的师兄指导,值~

2052 学习 · 1048 问题

查看课程