1: Eclipse集成Maven的spring项目打包时报错:Unknown lifecycle phase "blchina". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>: <goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>.
选中项目------>右键----->Run As------>Manven bulid-->填写Goals:clean package -Dmaven.test.skip=true ---->Run
2:执行Maven build 命令时Failed to execute goal on project blchina-cbp: Could not resolve dependencies for project cbp:war:1.0-SNAPSHOT: The following artifacts could not be resolved: service:jar:1.0-SNAPSHOT, common:jar:1.0-SNAPSHOT: Could not find artifact service:jar:1.0-SNAPSHOT
正确的用法是在父工程的pom.xml上执行程序
3:项目上使用Spring MVC和Mybatis时出现如下错误:
No qualifying bean of type [com.*.*.*.*.*.dao.CustomerDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations
是由于在工程目录下创建了多级目录,标签中没有进行“添加“多级的配置(原来的该配置文件中只有两级目录,需要再添加一级)
在spring.xml配置中修改如下配置:
<!-- 配置扫描器 -->
<beanclass="org.mybatis.spring.mapper.MapperScannerConfigurer">
<propertyname="basePackage"value="com.blchina.dao;com.blchina.cbp.dao;com.blchina.cbp.model;com.blchina.cbp.service.impl;"/>
<propertyname="sqlSessionFactoryBeanName"value="sqlSessionFactory"/>
</bean>
4: 有时会遇到maven本地库已经下载存有相关的jar包,pom.xml中也添加了,但是eclipse项目经过maven build之后Maven Dependencies中 却始终没有关联这个jar包,导致编译报错--找不到这个相应的jar中的类。
解决办法: 右键项目---Maven---Update Project...
5:启动tomcat
Cannot find bin/catalina.sh
The file is absent or does not have execute permission
This file is needed to run this program
原因: 没有权限
解决 : chmod 777 *.sh