1.maven 驱动包中的 mysql-connector-java 版本号与数据库的版本有关
https://blog.csdn.net/lingeio/article/details/93487770
2. 驱动时区问题
Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The server time zone value '锟叫癸拷锟斤拷准时锟斤拷' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support
需要在数据库连接设置 serverTimezone=UTC
3. tomcat 启动时,没有找到jar可以手动在idea -> project Structure -> Artifacts 新建一个lib文件夹手动把jar放进去
4 处理找不到xml路径的问题
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
5 spring包扫描 :扫描包文件中的spring注解
<context:component-scan base-package="*"/>