{"id":3980,"date":"2019-03-11T13:37:24","date_gmt":"2019-03-11T05:37:24","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=3980"},"modified":"2019-03-11T13:37:24","modified_gmt":"2019-03-11T05:37:24","slug":"%e8%a7%a3%e5%86%b3-springboot-%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6%e6%8f%90%e7%a4%ba-cannot-resolve-class-or-package-jdbc-less-%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=3980","title":{"rendered":"\u89e3\u51b3 Springboot \u914d\u7f6e\u6587\u4ef6\u63d0\u793a Cannot resolve class or package \u2018jdbc\u2019 less\u2026 \u95ee\u9898"},"content":{"rendered":"<p>\n\t\u6700\u8fd1\u5728\u505a\u4e00\u4e2a SpringBoot \u7684\u9879\u76ee\uff0c\u7528\u5230\u4e86\u6570\u636e\u5e93\u3002\u6240\u4ee5\u5728 yml \u4e2d\u914d\u7f6e\u4e86 driver-class-name: com.mysql.jdbc.Driver\u3002\u4f46\u662f\u4fdd\u5b58\u4e4b\u540e\uff0cyml \u6587\u4ef6\u63d0\u793a\uff1aCannot resolve class or package &lsquo;jdbc&rsquo; less&hellip;\n<\/p>\n<p>\n\t\u8be6\u7ec6\u5185\u5bb9\u5982\u4e0b\uff1a\n<\/p>\n<p>\n\tCannot resolve class or package &lsquo;jdbc&rsquo; less&hellip; (Ctrl+F1) Inspection info: Checks Spring Boot application .properties configuration files. Highlights unresolved and deprecated configuration keys and invalid values.\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"Springboot \u914d\u7f6e\u6587\u4ef6\u9519\u8bef\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/wx1.sinaimg.cn\/large\/8fa5dcfcgy1g0ysqgmegjj20qd029gm8.jpg\" style=\"width: 949px;height: 81px\" \/>\n<\/p>\n<p>\n\t\u8fd9\u4e2a\u9519\u8bef\u7684\u5927\u6982\u610f\u601d\u662f\u8bf4\uff1a\u65e0\u6cd5\u89e3\u6790&nbsp;jdbc \u7c7b\u6216\u5305\u3002\n<\/p>\n<p>\n\t\u8bf4\u767d\u4e86\uff0c\u5c31\u662f\u6ca1\u6709\u627e\u5230&nbsp;com.mysql.jdbc.Driver \u8fd9\u4e2a\u4e1c\u897f\u3002\n<\/p>\n<p>\n\t\u867d\u7136\u8fd9\u4e2a\u9519\u8bef\uff0c\u5e76\u4e0d\u5f71\u54cd\u8fd0\u884c\u3002\u4f46\u662f\u770b\u8d77\u6765\u7279\u522b\u522b\u626d\uff01\n<\/p>\n<p>\n\t\u4e8e\u662f\uff0c\u6211\u770b\u4e86\u6211\u7684 pom.xml \u6587\u4ef6\u4e2d\u5f15\u5165\u4e86&nbsp;mysql-connector-java\u3002\u552f\u4e00\u7684\u53ef\u80fd\u5c31\u662f&nbsp;scope \u914d\u7f6e\u7684\u4e0d\u5bf9\u3002\n<\/p>\n<pre class=\"brush:java;\">\r\n&lt;dependency&gt;\r\n    &lt;groupId&gt;mysql&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;mysql-connector-java&lt;\/artifactId&gt;\r\n    &lt;scope&gt;runtime&lt;\/scope&gt;\r\n&lt;\/dependency&gt;<\/pre>\n<p>\n\t\u7136\u540e\uff0c\u6211\u628a&nbsp;scope \u914d\u7f6e\u53bb\u6389\uff0c\u6216\u8005\u6539\u6210&nbsp;compile&nbsp;\u540e\uff0c\u9519\u8bef\u5c31\u6d88\u5931\u4e86\uff0c\u95ee\u9898\u5c31\u89e3\u51b3\u4e86\uff01<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=3980\">\u89e3\u51b3 Springboot \u914d\u7f6e\u6587\u4ef6\u63d0\u793a Cannot resolve class or package \u2018jdbc\u2019 less\u2026 \u95ee\u9898<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5728\u505a\u4e00\u4e2a SpringBoot \u7684\u9879\u76ee\uff0c\u7528\u5230\u4e86\u6570\u636e\u5e93\u3002\u6240\u4ee5\u5728 yml \u4e2d\u914d\u7f6e\u4e86 driver-class- [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[950,1784,1522,590,785],"class_list":["post-3980","post","type-post","status-publish","format-standard","hentry","category-yyzt","tag-jdbcrealm","tag-jdbctype","tag-springboot","tag-springboottest","tag-785"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3980","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3980"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3980\/revisions"}],"predecessor-version":[{"id":3981,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3980\/revisions\/3981"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}