Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/355.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法执行目标org.apache.maven.plugins(spring框架依赖项)_Java_Maven_Spring Mvc_Intellij Idea_Spring Boot - Fatal编程技术网

Java 无法执行目标org.apache.maven.plugins(spring框架依赖项)

Java 无法执行目标org.apache.maven.plugins(spring框架依赖项),java,maven,spring-mvc,intellij-idea,spring-boot,Java,Maven,Spring Mvc,Intellij Idea,Spring Boot,我今天早上打开IntelliJ看到了这个。没有对代码进行任何更改。我删除了本地的.m2存储库,并重新下载了所有依赖项。我还是有同样的问题。为什么我的基本spring库没有被导入 错误: [INFO] Changes detected - recompiling the module! [INFO] Compiling 17 source files to C:\Users\martin\Documents\Web Projects\home.office\target\classes [INF

我今天早上打开IntelliJ看到了这个。没有对代码进行任何更改。我删除了本地的.m2存储库,并重新下载了所有依赖项。我还是有同样的问题。为什么我的基本spring库没有被导入

错误:

[INFO] Changes detected - recompiling the module!
[INFO] Compiling 17 source files to C:\Users\martin\Documents\Web Projects\home.office\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/UserController.java:[45,45] incompatible types: java.util.Optional<geo.app.entity.Users> cannot be converted to geo.app.entity.Users
[ERROR] /C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[139,54] incompatible types: java.util.Optional<geo.app.entity.RequestDO> cannot be converted to geo.app.entity.RequestDO
[ERROR] /C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[140,49] incompatible types: java.util.Optional<geo.app.entity.Users> cannot be converted to geo.app.entity.Users
[ERROR] /C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[155,54] incompatible types: java.util.Optional<geo.app.entity.RequestDO> cannot be converted to geo.app.entity.RequestDO
[ERROR] /C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[157,49] incompatible types: java.util.Optional<geo.app.entity.Users> cannot be converted to geo.app.entity.Users
[INFO] 5 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:43 min
[INFO] Finished at: 2017-03-24T11:12:29+01:00
[INFO] Final Memory: 36M/255M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project demo: Compilation failure: Compilation failure:
[ERROR] /C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/UserController.java:[45,45] incompatible types: java.util.Optional<geo.app.entity.Users> cannot be converted to geo.app.entity.Users
[ERROR] /C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[139,54] incompatible types: java.util.Optional<geo.app.entity.RequestDO> cannot be converted to geo.app.entity.RequestDO
[ERROR] /C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[140,49] incompatible types: java.util.Optional<geo.app.entity.Users> cannot be converted to geo.app.entity.Users
[ERROR] /C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[155,54] incompatible types: java.util.Optional<geo.app.entity.RequestDO> cannot be converted to geo.app.entity.RequestDO
[ERROR] /C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[157,49] incompatible types: java.util.Optional<geo.app.entity.Users> cannot be converted to geo.app.entity.Users
[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
[INFO]检测到更改-重新编译模块!
[信息]将17个源文件编译为C:\Users\martin\Documents\Web Projects\home.office\target\classes
[信息]-------------------------------------------------------------
[错误]编译错误:
[信息]-------------------------------------------------------------
[错误]/C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/UserController.java:[45,45]不兼容的类型:java.util.Optional无法转换为geo.app.entity.Users
[错误]/C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[139,54]不兼容的类型:java.util.Optional无法转换为geo.app.entity.RequestDO
[错误]/C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[140,49]不兼容的类型:java.util.Optional无法转换为geo.app.entity.Users
[错误]/C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[155,54]不兼容的类型:java.util.Optional无法转换为geo.app.entity.RequestDO
[错误]/C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[157,49]不兼容的类型:java.util.Optional无法转换为geo.app.entity.Users
[信息]5个错误
[信息]-------------------------------------------------------------
[信息]------------------------------------------------------------------------
[信息]生成失败
[信息]------------------------------------------------------------------------
[信息]总时间:01:43分钟
[信息]完成时间:2017-03-24T11:12:29+01:00
[信息]最终内存:36M/255M
[信息]------------------------------------------------------------------------
[错误]未能在项目演示上执行目标org.apache.maven.plugins:maven编译器插件:3.1:compile(默认编译):编译失败:编译失败:
[错误]/C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/UserController.java:[45,45]不兼容的类型:java.util.Optional无法转换为geo.app.entity.Users
[错误]/C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[139,54]不兼容的类型:java.util.Optional无法转换为geo.app.entity.RequestDO
[错误]/C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[140,49]不兼容的类型:java.util.Optional无法转换为geo.app.entity.Users
[错误]/C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[155,54]不兼容的类型:java.util.Optional无法转换为geo.app.entity.RequestDO
[错误]/C:/Users/martin/Documents/Web Projects/home.office/src/main/java/geo/app/controller/RequestController.java:[157,49]不兼容的类型:java.util.Optional无法转换为geo.app.entity.Users
[错误]->[帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整调试日志记录。
[错误]
[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:
[错误][帮助1]http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

尝试从命令行运行mvn clean install,如果您不导入pom.xml中的更改,intellij有时会表现得很奇怪。我已经尝试过了,但仍然收到相同的错误…您是否在intellij的Maven侧栏上“重新导入所有Maven项目”?这将同步pom和模块依赖项设置。谢谢。这起作用了。我按Ctrl+Shift+A并搜索“重新导入所有Maven项目”。对不起。我说得太快了。仍然有一些缺少的依赖项导致相同的生成失败。我会一直尝试重新导入,直到它工作。。