{"id":3215,"date":"2023-01-05T16:43:33","date_gmt":"2023-01-05T08:43:33","guid":{"rendered":"https:\/\/qaqaq.top\/?p=3215"},"modified":"2023-01-05T18:03:04","modified_gmt":"2023-01-05T10:03:04","slug":"%e4%bd%bf%e7%94%a8maven%ef%bc%9a%e6%89%a7%e8%a1%8c-maven-%e7%9a%84%e6%9e%84%e5%bb%ba%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/qaqaq.top\/?p=3215","title":{"rendered":"\u4f7f\u7528Maven\uff1a\u6267\u884c Maven \u7684\u6784\u5efa\u547d\u4ee4"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1\u3001\u8981\u6c42<\/h2>\n\n\n\n<p>\u8fd0\u884c Maven \u4e2d\u548c\u6784\u5efa\u64cd\u4f5c\u76f8\u5173\u7684\u547d\u4ee4\u65f6\uff0c\u5fc5\u987b\u8fdb\u5165\u5230 pom.xml \u6240\u5728\u7684\u76ee\u5f55\u3002\u5982\u679c\u6ca1\u6709\u5728 pom.xml \u6240\u5728\u7684\u76ee\u5f55\u8fd0\u884c Maven \u7684\u6784\u5efa\u547d\u4ee4\uff0c\u90a3\u4e48\u4f1a\u770b\u5230\u4e0b\u9762\u7684\u9519\u8bef\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>The goal you specified requires a project to execute but there is no POM in this directory\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>mvn -v \u547d\u4ee4\u548c\u6784\u5efa\u64cd\u4f5c\u65e0\u5173\uff0c\u53ea\u8981\u6b63\u786e\u914d\u7f6e\u4e86 PATH\uff0c\u5728\u4efb\u4f55\u76ee\u5f55\u4e0b\u6267\u884c\u90fd\u53ef\u4ee5\u3002\u800c\u6784\u5efa\u76f8\u5173\u7684\u547d\u4ee4\u8981\u5728 pom.xml \u6240\u5728\u76ee\u5f55\u4e0b\u8fd0\u884c\u2014\u2014\u64cd\u4f5c\u54ea\u4e2a\u5de5\u7a0b\uff0c\u5c31\u8fdb\u5165\u8fd9\u4e2a\u5de5\u7a0b\u7684 pom.xml \u76ee\u5f55\u3002<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">2\u3001\u6e05\u7406\u64cd\u4f5c<\/h2>\n\n\n\n<p>mvn clean<\/p>\n\n\n\n<p>\u6548\u679c\uff1a\u5220\u9664 target \u76ee\u5f55<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3\u3001\u7f16\u8bd1\u64cd\u4f5c<\/h2>\n\n\n\n<p>\u4e3b\u7a0b\u5e8f\u7f16\u8bd1\uff1amvn compile<\/p>\n\n\n\n<p>\u6d4b\u8bd5\u7a0b\u5e8f\u7f16\u8bd1\uff1amvn test-compile<\/p>\n\n\n\n<p>\u4e3b\u4f53\u7a0b\u5e8f\u7f16\u8bd1\u7ed3\u679c\u5b58\u653e\u7684\u76ee\u5f55\uff1atarget\/classes<\/p>\n\n\n\n<p>\u6d4b\u8bd5\u7a0b\u5e8f\u7f16\u8bd1\u7ed3\u679c\u5b58\u653e\u7684\u76ee\u5f55\uff1atarget\/test-classes<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4\u3001\u6d4b\u8bd5\u64cd\u4f5c<\/h2>\n\n\n\n<p>mvn test<\/p>\n\n\n\n<p>\u6d4b\u8bd5\u7684\u62a5\u544a\u5b58\u653e\u7684\u76ee\u5f55\uff1atarget\/surefire-reports<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5\u3001\u6253\u5305\u64cd\u4f5c<\/h2>\n\n\n\n<p>mvn package<\/p>\n\n\n\n<p>\u6253\u5305\u7684\u7ed3\u679c\u2014\u2014jar \u5305\uff0c\u5b58\u653e\u7684\u76ee\u5f55\uff1atarget<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6\u3001\u5b89\u88c5\u64cd\u4f5c<\/h2>\n\n\n\n<p>mvn install<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;INFO] Installing D:\\maven-workspace\\space201026\\pro01-maven-java\\target\\pro01-maven-java-1.0-SNAPSHOT.jar to D:\\maven-rep1026\\top\\qaqaq\\maven\\pro01-maven-java\\1.0-SNAPSHOT\\pro01-maven-java-1.0-SNAPSHOT.jar\n&#91;INFO] Installing D:\\maven-workspace\\space201026\\pro01-maven-java\\pom.xml to D:\\maven-rep1026\\top\\qaqaq\\maven\\pro01-maven-java\\1.0-SNAPSHOT\\pro01-maven-java-1.0-SNAPSHOT.pom\n<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u7684\u6548\u679c\u662f\u5c06\u672c\u5730\u6784\u5efa\u8fc7\u7a0b\u4e2d\u751f\u6210\u7684 jar \u5305\u5b58\u5165 Maven \u672c\u5730\u4ed3\u5e93\u3002\u8fd9\u4e2a jar \u5305\u5728 Maven \u4ed3\u5e93\u4e2d\u7684\u8def\u5f84\u662f\u6839\u636e\u5b83\u7684\u5750\u6807\u751f\u6210\u7684\u3002<\/p>\n\n\n\n<p>\u5750\u6807\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  &lt;groupId>top.qaqaq.maven&lt;\/groupId>\n  &lt;artifactId>pro01-maven-java&lt;\/artifactId>\n  &lt;version>1.0-SNAPSHOT&lt;\/version>\n<\/code><\/pre>\n\n\n\n<p>\u5728 Maven \u4ed3\u5e93\u4e2d\u751f\u6210\u7684\u8def\u5f84\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\maven-rep1026\\top\\qaqaq\\maven\\pro01-maven-java\\1.0-SNAPSHOT\\pro01-maven-java-1.0-SNAPSHOT.jar\n<\/code><\/pre>\n\n\n\n<p>\u53e6\u5916\uff0c\u5b89\u88c5\u64cd\u4f5c\u8fd8\u4f1a\u5c06 pom.xml \u6587\u4ef6\u8f6c\u6362\u4e3a XXX.pom \u6587\u4ef6\u4e00\u8d77\u5b58\u5165\u672c\u5730\u4ed3\u5e93\u3002\u6240\u4ee5\u6211\u4eec\u5728 Maven \u7684\u672c\u5730\u4ed3\u5e93\u4e2d\u60f3\u770b\u4e00\u4e2a jar \u5305\u539f\u59cb\u7684 pom.xml \u6587\u4ef6\u65f6\uff0c\u67e5\u770b\u5bf9\u5e94 XXX.pom \u6587\u4ef6\u5373\u53ef\uff0c\u5b83\u4eec\u662f\u540d\u5b57\u53d1\u751f\u4e86\u6539\u53d8\uff0c\u672c\u8d28\u4e0a\u662f\u540c\u4e00\u4e2a\u6587\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u8981\u6c42 \u8fd0\u884c Maven \u4e2d\u548c\u6784\u5efa\u64cd\u4f5c\u76f8\u5173\u7684\u547d\u4ee4\u65f6\uff0c\u5fc5\u987b\u8fdb\u5165\u5230 pom.xml \u6240\u5728\u7684\u76ee\u5f55\u3002\u5982\u679c\u6ca1\u6709\u5728 po [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[122],"tags":[130],"class_list":["post-3215","post","type-post","status-publish","format-standard","hentry","category-maven-code","tag-maven"],"_links":{"self":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/3215"}],"collection":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3215"}],"version-history":[{"count":2,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/3215\/revisions"}],"predecessor-version":[{"id":3239,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/3215\/revisions\/3239"}],"wp:attachment":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}