
{"id":2532,"date":"2020-11-28T10:08:21","date_gmt":"2020-11-28T02:08:21","guid":{"rendered":"http:\/\/127.0.0.2\/?p=2532"},"modified":"2020-11-28T10:08:21","modified_gmt":"2020-11-28T02:08:21","slug":"2020javaweb%e6%a1%86%e6%9e%b6%e6%95%99%e7%a8%8b%e4%b9%8bidea%e9%85%8d%e7%bd%aemaven%e4%bb%a5%e5%8f%8a%e9%85%8d%e7%bd%aetomcat","status":"publish","type":"post","link":"https:\/\/www.9713job.com\/?p=2532","title":{"rendered":"2020javaweb\u6846\u67b6\u6559\u7a0b\u4e4bidea\u914d\u7f6emaven\u4ee5\u53ca\u914d\u7f6eTomcat"},"content":{"rendered":"<h3>2020javaweb\u6846\u67b6\u6559\u7a0b\u4e4bidea\u914d\u7f6emaven\u4ee5\u53ca\u914d\u7f6eTomcat<\/h3>\n<p><strong><span style=\"color: #ff0000;\">idea\u914d\u7f6emaven<\/span><\/strong><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/27\/1.png\" alt=\"\" width=\"680\" \/><\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u9009\u62e9\u9aa8\u67b6<\/strong><\/span><\/p>\n<p>\u521b\u5efamaven\u9879\u76ee\uff0c\u9009\u62e9\u9aa8\u67b6<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/27\/2.png\" alt=\"\" width=\"680\" \/><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/27\/3.png\" alt=\"\" width=\"680\" \/><\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u9879\u76ee\u7ed3\u6784<\/strong><\/span><\/p>\n<p><span style=\"color: #33cccc;\">java\u9879\u76ee\uff1a<\/span><br \/>\n<span style=\"color: #33cccc;\">1.src\/main\/java \u5b58\u653e\u6e90\u4ee3\u7801\uff0c\u5efa\u5305\uff0c\u653e\u9879\u2f6c\u4e2d\u4ee3\u7801(service,dao,User,&#8230;.)<\/span><br \/>\n<span style=\"color: #33cccc;\">2.src\/main\/resources \u4e66\u5199\u914d\u7f6e\u2f42\u4ef6\uff0c\u9879\u2f6c\u4e2d\u7684\u914d\u7f6e\u2f42\u4ef6(jdbc.properties)<\/span><br \/>\n<span style=\"color: #33cccc;\">3.src\/test\/java \u4e66\u5199\u6d4b\u8bd5\u4ee3\u7801\uff0c\u9879\u2f6c\u4e2d\u6d4b\u8bd5\u6848\u4f8b\u4ee3\u7801<\/span><br \/>\n<span style=\"color: #33cccc;\">4.src\/test\/resources \u4e66\u5199\u6d4b\u8bd5\u6848\u4f8b\u76f8\u5173\u914d\u7f6e\u2f42\u4ef6<\/span><br \/>\n<span style=\"color: #33cccc;\">5.\u9879\u2f6c\u6839\/pom.xml (project object model) maven\u9879\u2f6c\u6838\u2f3c\u2f42\u4ef6\uff0c\u5176\u4e2d\u5b9a\u4e49\u9879\u2f6c\u6784\u5efa\u2f45\u5f0f\uff0c\u58f0\u660e\u4f9d\u8d56\u7b49<\/span><br \/>\n<span style=\"color: #33cccc;\">\u6ce8\u610f\uff1a\u9879\u2f6c\u4e2d\u7684\u5efa\u5305\uff0c\u5efa\u7c7b\uff0c\u6267\u2f8f\uff0c\u90fd\u548c\u666e\u901a\u9879\u2f6c\u2f46\u5dee\u5f02<\/span><\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u5bfc\u5165\u4f9d\u8d56jar<\/strong><\/span><\/p>\n<p>\u5efa\u597d\u9879\u2f6c\u540e\uff0c\u9700\u8981\u5bfc\u2f0a\u9700\u8981\u7684jar\uff0c\u8981\u901a\u8fc7\u3010\u5750\u6807\u3011<br \/>\n1. \u6bcf\u4e2a\u6784\u4ef6\u90fd\u6709\u2f83\u2f30\u7684\u5750\u6807(\u6807\u8bc6) = groupId + artifactId + version = \u9879\u2f6c\u6807\u8bc6 + \u9879\u2f6c\u540d + \u7248\u672c<br \/>\n2. \u5728maven\u9879\u2f6c\u4e2d\u53ea\u9700\u8981\u914d\u7f6e\u5750\u6807\uff0cmaven\u4fbf\u4f1a\u2f83\u52a8\u52a0\u8f7d\u5bf9\u5e94\u4f9d\u8d56\u3002\u5220\u9664\u5750\u6807\u5219\u4f1a\u79fb\u9664\u4f9d\u8d56<br \/>\n3. jar\u5305\u5e76\u4e0d\u4f1a\u5bfc\u2f0a\u5230\u9879\u2f6c\u2f6c\u5f55\u4e2d\uff0c\u53ea\u662fmaven\u5e2e\u52a9\u505a\u4e86\u5173\u8054\u3002\u4f46\u5728\u6253\u5305\u90e8\u7f72\u9879\u2f6c\u65f6\u4f1a\u643a\u5e26\u5bf9\u5e94\u4f9d\u8d56<br \/>\n4. \u2f7d\u4e14\uff0c\u5982\u679c\u5bfc\u2f0a\u4e86\u4f9d\u8d56A\uff0c\u2f7dA\u4e2d\u2f1c\u4f9d\u8d56\u4e86B\uff0c\u5219B\u4f1a\u88ab\u2f83\u52a8\u52a0\u8f7d\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u67e5\u627e\u4f9d\u8d56<\/strong><\/span><\/p>\n<p>\u4f9d\u8d56\u67e5\u627e\u670d\u52a1\uff1a<a href=\"https:\/\/mvnrepository.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/mvnrepository.com\/<\/a> \uff0c\u83b7\u5f97\u4f9d\u8d56\u7684\u5750\u6807\uff0c\u5728maven\u9879\u2f6c\u4e2d\u5bfc\u2f0a\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u5bfc\u5165\u4f9d\u8d56<\/strong><\/span><\/p>\n<p>\u5728\u9879\u76ee\u7684pom\u6587\u4ef6\u4e2d\uff1a<\/p>\n<pre>&lt;dependency&gt;\r\n  &lt;!-- jstl \u652f\u6301 --&gt;\r\n  &lt;groupId&gt;javax.servlet&lt;\/groupId&gt;\r\n  &lt;artifactId&gt;jstl&lt;\/artifactId&gt;\r\n  &lt;version&gt;1.2&lt;\/version&gt;\r\n  &lt;scope&gt;compile&lt;\/scope&gt;\r\n&lt;\/dependency&gt;&lt;!-- \u901a\u8fc7\u5750\u6807\u5bfc\u5165\u4f9d\u8d56 --&gt;<\/pre>\n<p><span style=\"color: #ff0000;\"><strong>\u540c\u6b65\u4f9d\u8d56<\/strong><\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/27\/4.png\" alt=\"\" width=\"680\" \/><\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u521b\u5efajavaweb\u9879\u76ee\u5bfc\u5165\u4f9d\u8d56<\/strong><\/span><\/p>\n<pre>&lt;dependency&gt;\r\n  &lt;!-- jstl \u652f\u6301 --&gt;\r\n  &lt;groupId&gt;javax.servlet&lt;\/groupId&gt;\r\n  &lt;artifactId&gt;jstl&lt;\/artifactId&gt;\r\n  &lt;version&gt;1.2&lt;\/version&gt;\r\n  &lt;scope&gt;compile&lt;\/scope&gt;\r\n&lt;\/dependency&gt;\r\n&lt;dependency&gt;\r\n  &lt;!-- servlet\u7f16\u8bd1\u73af\u5883 --&gt;\r\n  &lt;groupId&gt;javax.servlet&lt;\/groupId&gt;\r\n  &lt;artifactId&gt;javax.servlet-api&lt;\/artifactId&gt;\r\n  &lt;version&gt;3.1.0&lt;\/version&gt;\r\n  &lt;scope&gt;provided&lt;\/scope&gt;\r\n&lt;\/dependency&gt;\r\n&lt;dependency&gt;\r\n  &lt;!-- jsp\u7f16\u8bd1\u73af\u5883 --&gt;\r\n  &lt;groupId&gt;javax.servlet&lt;\/groupId&gt;\r\n  &lt;artifactId&gt;jsp-api&lt;\/artifactId&gt;\r\n  &lt;version&gt;2.0&lt;\/version&gt;\r\n  &lt;scope&gt;provided&lt;\/scope&gt;\r\n&lt;\/dependency&gt;<\/pre>\n<p><span style=\"color: #ff0000;\"><strong>\u914d\u7f6eTomcat<\/strong><\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/27\/5.png\" alt=\"\" width=\"680\" \/><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/27\/6.png\" alt=\"\" width=\"680\" \/><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/27\/7.png\" alt=\"\" width=\"680\" \/><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/27\/8.png\" alt=\"\" width=\"680\" \/><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-2254\" src=\"\/wp-content\/uploads\/2020\/11\/27\/9.png\" alt=\"\" width=\"680\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>2020javaweb\u6846\u67b6\u6559\u7a0b\u4e4bidea\u914d\u7f6emaven\u4ee5\u53ca\u914d\u7f6eTomcat idea\u914d\u7f6emaven \u9009\u62e9\u9aa8\u67b6  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-2532","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/posts\/2532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.9713job.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2532"}],"version-history":[{"count":1,"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/posts\/2532\/revisions"}],"predecessor-version":[{"id":2536,"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/posts\/2532\/revisions\/2536"}],"wp:attachment":[{"href":"https:\/\/www.9713job.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.9713job.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.9713job.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}