IDEA报错Could not resolve resource location pattern classpath:com/xxxxx/mapper/*.xml]解决办法

青旅半醒 2023-01-22 09:49 83阅读 0赞

https://blog.csdn.net/u010511598/article/details/104442482

  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  2. <modelVersion>4.0.0</modelVersion>
  3. <groupId>examsystem</groupId>
  4. <artifactId>ExamSystem</artifactId>
  5. <packaging>war</packaging>
  6. <version>0.0.1-SNAPSHOT</version>
  7. <name>ExamSystem Maven Webapp</name>
  8. <url>http://maven.apache.org</url>
  9. <properties>
  10. <project.build.sourceEncoding>GBK</project.build.sourceEncoding>
  11. <project.reporting.outputEncoding>GBK</project.reporting.outputEncoding>
  12. <!-- spring版本号 -->
  13. <spring.version>4.2.5.RELEASE</spring.version>
  14. <!-- mybatis版本号 -->
  15. <mybatis.version>3.2.8</mybatis.version>
  16. <!-- mysql驱动版本号 -->
  17. <mysql-driver.version>5.1.29</mysql-driver.version>
  18. <!-- log4j日志包版本号 -->
  19. <slf4j.version>1.7.18</slf4j.version>
  20. <log4j.version>1.2.17</log4j.version>
  21. </properties>
  22. <dependencies>
  23. <!-- <dependency> -->
  24. <!-- <groupId>com.mchange</groupId> -->
  25. <!-- <artifactId>c3p0</artifactId> -->
  26. <!-- <version>0.9.5-pre10</version> -->
  27. <!-- </dependency> -->
  28. <dependency>
  29. <groupId>commons-lang</groupId>
  30. <artifactId>commons-lang</artifactId>
  31. <version>2.6</version>
  32. </dependency>
  33. <dependency>
  34. <groupId>cn.hutool</groupId>
  35. <artifactId>hutool-all</artifactId>
  36. <version>4.5.7</version>
  37. </dependency>
  38. <!-- <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.9</version> </dependency> -->
  39. <dependency>
  40. <groupId>org.apache.poi</groupId>
  41. <artifactId>poi-ooxml</artifactId>
  42. <version>3.16</version>
  43. </dependency>
  44. <dependency>
  45. <groupId>com.alibaba</groupId>
  46. <artifactId>druid</artifactId>
  47. <version>1.0.2</version>
  48. </dependency>
  49. <dependency>
  50. <groupId>org.apache.geronimo.bundles</groupId>
  51. <artifactId>aspectjweaver</artifactId>
  52. <version>1.6.8_2</version>
  53. </dependency>
  54. <dependency>
  55. <groupId>c3p0</groupId>
  56. <artifactId>c3p0</artifactId>
  57. <version>0.9.1.2</version>
  58. </dependency>
  59. <dependency>
  60. <groupId>mysql</groupId>
  61. <artifactId>mysql-connector-java</artifactId>
  62. </dependency>
  63. <dependency>
  64. <groupId>jstl</groupId>
  65. <artifactId>jstl</artifactId>
  66. <version>1.2</version>
  67. </dependency>
  68. <dependency>
  69. <groupId>javax</groupId>
  70. <artifactId>javaee-api</artifactId>
  71. <version>7.0</version>
  72. </dependency>
  73. <!-- 添加junit4依赖 -->
  74. <dependency>
  75. <groupId>junit</groupId>
  76. <artifactId>junit</artifactId>
  77. <version>4.11</version>
  78. <!-- 指定范围,在测试时才会加载 -->
  79. <!-- <scope>test</scope> -->
  80. </dependency>
  81. <!-- 添加spring核心依赖 -->
  82. <dependency>
  83. <groupId>org.springframework</groupId>
  84. <artifactId>spring-core</artifactId>
  85. <version>${spring.version}</version>
  86. </dependency>
  87. <dependency>
  88. <groupId>org.springframework</groupId>
  89. <artifactId>spring-web</artifactId>
  90. <version>${spring.version}</version>
  91. </dependency>
  92. <dependency>
  93. <groupId>org.springframework</groupId>
  94. <artifactId>spring-oxm</artifactId>
  95. <version>${spring.version}</version>
  96. </dependency>
  97. <dependency>
  98. <groupId>org.springframework</groupId>
  99. <artifactId>spring-tx</artifactId>
  100. <version>${spring.version}</version>
  101. </dependency>
  102. <dependency>
  103. <groupId>org.springframework</groupId>
  104. <artifactId>spring-jdbc</artifactId>
  105. <version>${spring.version}</version>
  106. </dependency>
  107. <dependency>
  108. <groupId>org.springframework</groupId>
  109. <artifactId>spring-webmvc</artifactId>
  110. <version>${spring.version}</version>
  111. </dependency>
  112. <dependency>
  113. <groupId>org.springframework</groupId>
  114. <artifactId>spring-context</artifactId>
  115. <version>${spring.version}</version>
  116. </dependency>
  117. <dependency>
  118. <groupId>org.springframework</groupId>
  119. <artifactId>spring-context-support</artifactId>
  120. <version>${spring.version}</version>
  121. </dependency>
  122. <dependency>
  123. <groupId>org.springframework</groupId>
  124. <artifactId>spring-aop</artifactId>
  125. <version>${spring.version}</version>
  126. </dependency>
  127. <dependency>
  128. <groupId>org.springframework</groupId>
  129. <artifactId>spring-test</artifactId>
  130. <version>${spring.version}</version>
  131. </dependency>
  132. <!-- 添加mybatis依赖 -->
  133. <dependency>
  134. <groupId>org.mybatis</groupId>
  135. <artifactId>mybatis</artifactId>
  136. <version>${mybatis.version}</version>
  137. </dependency>
  138. <!-- 添加mybatis/spring整合包依赖 -->
  139. <dependency>
  140. <groupId>org.mybatis</groupId>
  141. <artifactId>mybatis-spring</artifactId>
  142. <version>1.2.2</version>
  143. </dependency>
  144. <!-- 添加mysql驱动依赖 -->
  145. <dependency>
  146. <groupId>mysql</groupId>
  147. <artifactId>mysql-connector-java</artifactId>
  148. <version>${mysql-driver.version}</version>
  149. </dependency>
  150. <!-- 添加数据库连接池依赖 -->
  151. <dependency>
  152. <groupId>commons-dbcp</groupId>
  153. <artifactId>commons-dbcp</artifactId>
  154. <version>1.2.2</version>
  155. </dependency>
  156. <!-- 添加fastjson -->
  157. <dependency>
  158. <groupId>com.alibaba</groupId>
  159. <artifactId>fastjson</artifactId>
  160. <version>1.1.41</version>
  161. </dependency>
  162. <!-- 添加日志相关jar包 -->
  163. <dependency>
  164. <groupId>log4j</groupId>
  165. <artifactId>log4j</artifactId>
  166. <version>${log4j.version}</version>
  167. </dependency>
  168. <dependency>
  169. <groupId>org.slf4j</groupId>
  170. <artifactId>slf4j-api</artifactId>
  171. <version>${slf4j.version}</version>
  172. </dependency>
  173. <dependency>
  174. <groupId>org.slf4j</groupId>
  175. <artifactId>slf4j-log4j12</artifactId>
  176. <version>${slf4j.version}</version>
  177. </dependency>
  178. <!-- log end -->
  179. <!-- 映入JSON -->
  180. <dependency>
  181. <groupId>org.codehaus.jackson</groupId>
  182. <artifactId>jackson-mapper-asl</artifactId>
  183. <version>1.9.13</version>
  184. </dependency>
  185. <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
  186. <dependency>
  187. <groupId>com.fasterxml.jackson.core</groupId>
  188. <artifactId>jackson-core</artifactId>
  189. <version>2.8.0</version>
  190. </dependency>
  191. <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
  192. <dependency>
  193. <groupId>com.fasterxml.jackson.core</groupId>
  194. <artifactId>jackson-databind</artifactId>
  195. <version>2.8.0</version>
  196. </dependency>
  197. <dependency>
  198. <groupId>commons-fileupload</groupId>
  199. <artifactId>commons-fileupload</artifactId>
  200. <version>1.3.1</version>
  201. </dependency>
  202. <dependency>
  203. <groupId>commons-io</groupId>
  204. <artifactId>commons-io</artifactId>
  205. <version>2.4</version>
  206. </dependency>
  207. <dependency>
  208. <groupId>commons-codec</groupId>
  209. <artifactId>commons-codec</artifactId>
  210. <version>1.9</version>
  211. </dependency>
  212. <!-- https://mvnrepository.com/artifact/com.github.abel533/ECharts -->
  213. <dependency>
  214. <groupId>com.github.abel533</groupId>
  215. <artifactId>ECharts</artifactId>
  216. <version>3.0.0</version>
  217. </dependency>
  218. <dependency>
  219. <groupId>com.google.code.gson</groupId>
  220. <artifactId>gson</artifactId>
  221. <version>2.5</version>
  222. <scope>compile</scope>
  223. <optional>true</optional>
  224. </dependency>
  225. <dependency>
  226. <groupId>net.sf.jxls</groupId>
  227. <artifactId>jxls-core</artifactId>
  228. <version>1.0.5</version>
  229. </dependency>
  230. <!-- mybatis分页插件依赖 -->
  231. <dependency>
  232. <groupId>com.github.pagehelper</groupId>
  233. <artifactId>pagehelper</artifactId>
  234. <version>4.0.0</version>
  235. </dependency>
  236. <!-- urlrewrite功能集成所需要的jar包 -->
  237. <dependency>
  238. <groupId>org.tuckey</groupId>
  239. <artifactId>urlrewritefilter</artifactId>
  240. <version>4.0.4</version>
  241. </dependency>
  242. <!--引入JWT依赖,由于是基于Java,所以需要的是java-jwt-->
  243. <dependency>
  244. <groupId>io.jsonwebtoken</groupId>
  245. <artifactId>jjwt</artifactId>
  246. <version>0.9.1</version>
  247. </dependency>
  248. <dependency>
  249. <groupId>com.auth0</groupId>
  250. <artifactId>java-jwt</artifactId>
  251. <version>2.2.0</version>
  252. </dependency>
  253. <!-- 处理跨域问题所需要的jar包 -->
  254. <dependency>
  255. <groupId>com.thetransactioncompany</groupId>
  256. <artifactId>cors-filter</artifactId>
  257. <version>2.6</version>
  258. </dependency>
  259. </dependencies>
  260. <build>
  261. <finalName>ExamSystem</finalName>
  262. <plugins>
  263. <plugin>
  264. <groupId>org.mybatis.generator</groupId>
  265. <artifactId>mybatis-generator-maven-plugin</artifactId>
  266. <version>1.3.2</version>
  267. <configuration>
  268. <verbose>true</verbose>
  269. <overwrite>true</overwrite>
  270. </configuration>
  271. </plugin>
  272. <!-- define the project compile level -->
  273. <plugin>
  274. <groupId>org.apache.maven.plugins</groupId>
  275. <artifactId>maven-compiler-plugin</artifactId>
  276. <version>2.3.2</version>
  277. <configuration>
  278. <source>1.8</source>
  279. <target>1.8</target>
  280. </configuration>
  281. </plugin>
  282. </plugins>
  283. <!-- 因为resources若不配置,可能会发送打包不全-->
  284. <resources>
  285. <resource>
  286. <!--需要打包的目录-->
  287. <directory>src/main/java</directory>
  288. <!--目录中的文件类型-->
  289. <includes>
  290. <include>**/*.xml</include>
  291. <include>**/*.properties</include>
  292. </includes>
  293. </resource>
  294. <resource>
  295. <directory>src/main/resources</directory>
  296. <includes>
  297. <include>**/*.xml</include>
  298. <include>**/*.properties</include>
  299. </includes>
  300. </resource>
  301. </resources>
  302. </build>
  303. </project>

发表评论

表情:
评论列表 (有 0 条评论,83人围观)

还没有评论,来说两句吧...

相关阅读