maven mvn compile 报错是啥原因
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven mvn compile 报错是啥原因相关的知识,希望对你有一定的参考价值。
Microsoft Windows [版本 6.3.9600]
(c) 2013 Microsoft Corporation。保留所有权利。
C:\Users\Administrator>d:
D:\>mvn compile
D:\
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.065 s
[INFO] Finished at: 2015-12-04T10:29:32+08:00
[INFO] Final Memory: 5M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM
in this directory (D:\). Please verify you invoked Maven from the correct direc
tory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProject
Exception
D:\>
spring mvc注入service报错是啥原因?
部分代码如下:
报错:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private myforum.service.UserTest myforum.controller.UserController.userTest; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [myforum.service.UserTest] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: org.springframework.beans.factory.annotation.Autowired(required=true)
配置如下:web.xmlcontextConfigLocationclasspath:spring.xml,classpath:spring-hibernate.xmlspring mvc servletspringMvcorg.springframework.web.servlet.DispatcherServletspring mvc 配置文件contextConfigLocationclasspath:spring-mvc.xml1 springMvc*.action spring.xmlspring-mvc.xml
需要的都提供了 应该没错,就是注入错误。求牛人解答
从controller到service到dao全部检查一遍;
或者全部粘贴出来,才能看到问题。
以上是关于maven mvn compile 报错是啥原因的主要内容,如果未能解决你的问题,请参考以下文章