{"id":1445,"date":"2024-05-08T11:07:52","date_gmt":"2024-05-08T03:07:52","guid":{"rendered":"http:\/\/oneai.eu.org\/?p=1445"},"modified":"2024-05-08T11:07:52","modified_gmt":"2024-05-08T03:07:52","slug":"maven_pom-xml","status":"publish","type":"post","link":"https:\/\/oneai.eu.org\/?p=1445","title":{"rendered":"Maven_pom.xml"},"content":{"rendered":"<pre><code class=\"language-xml\">\u7b80\u5355\u7684\u914d\u7f6e\u5b9e\u4f8b:\n&lt;project xmlns=&quot;http:\/\/maven.apache.org\/POM\/4.0.0&quot; xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd&quot;&gt;\n  &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\n  &lt;groupId&gt;TheFirsttestMaven&lt;\/groupId&gt;\n  &lt;artifactId&gt;TheFirsttestMaven&lt;\/artifactId&gt;\n  &lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\n  &lt;build&gt;\n                        &lt;plugins&gt;\n                                &lt;plugin&gt;\n                                        &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\n                                        &lt;artifactId&gt;maven-shade-plugin&lt;\/artifactId&gt;\n                                        &lt;version&gt;2.1&lt;\/version&gt;\n                                        &lt;executions&gt;\n                                                &lt;execution&gt;\n                                                        &lt;phase&gt;package&lt;\/phase&gt;\n                                                        &lt;goals&gt;\n                                                                &lt;goal&gt;shade&lt;\/goal&gt;\n                                                        &lt;\/goals&gt;\n                                                        &lt;configuration&gt;\n                                                                &lt;transformers&gt;\n                                                                        &lt;transformer implementation=&quot;org.apache.maven.plugins.shade.resource.ManifestResourceTransformer&quot;&gt;\n                                                                                &lt;mainClass&gt;FirstDemo&lt;\/mainClass&gt;\n                                                                        &lt;\/transformer&gt;\n                                                                &lt;\/transformers&gt;\n                                                        &lt;\/configuration&gt;\n                                                &lt;\/execution&gt;\n                                        &lt;\/executions&gt;\n                                &lt;\/plugin&gt;\n                        &lt;\/plugins&gt;\n                &lt;\/build&gt;\n&lt;\/project&gt;\n<\/code><\/pre>\n<hr \/>\n<p>\u8868 1 -2 Maven \u7f16\u8bd1\u547d\u4ee4<br \/>\n\u547d \u4ee4 \u542b \u4e49<br \/>\nmvn clean                                            \u6e05\u7406\u7f16\u8bd1\u7ed3\u679c<br \/>\nmvn compile [-Pnative]                               \u7f16\u8bd1\u6e90\u4ee3\u7801<br \/>\nmvn test [-Pnative]                                   \u8fd0\u884c\u6d4b\u8bd5\u7a0b\u5e8f<br \/>\nmvn package                                          \u521b\u5efa JAR \u5305<br \/>\nmvn compile findbugs:findbugs                       \u8fd0\u884c findbugs<br \/>\nmvn compile checkstyle:checkstyle                     \u8fd0\u884c checkstyle\uff08 \u68c0\u67e5\u7f16\u7a0b\u89c4\u8303\uff09<br \/>\nmvn install                                           \u5c06 JAR \u5305\u653e\u5230 M2 \u7f13\u5b58\u4e2d<br \/>\nmvn deploy                                            \u5c06 JAR \u90e8\u7f72\u5230 Maven \u4ed3\u5e93\u4e2d<br \/>\nmvn package [-Pdist][-Pdocs][-Psrc][-Pnative][-Dtar] \u6784\u5efa\u53d1\u5e03\u7248<br \/>\nmvn versions:set -DnewVersion=NEWVERSION           \u4fee\u6539 Hadoop \u7248\u672c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u5355\u7684\u914d\u7f6e\u5b9e\u4f8b: &lt;project xmlns=&quot;http:\/\/maven.apache.org\/POM\/4.0.0&quot; xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd&quot;&gt; &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt; &lt;groupId&gt;TheFirsttestMaven&lt;\/groupId&gt; &lt;artifactId&gt;TheFirsttestMaven&lt;\/artifactId&gt; &lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt; &lt;artifactId&gt;maven-shade-plugin&lt;\/artifactId&gt; &lt;version&gt;2.1&lt;\/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;package&lt;\/phase&gt; &lt;goals&gt; &lt;goal&gt;shade&lt;\/goal&gt; &lt;\/goals&gt; &lt;configuration&gt; &lt;transformers&gt; &lt;transformer implementation=&quot;org.apache.maven.plugins.shade.resource.ManifestResourceTransformer&quot;&gt; &lt;mainClass&gt;FirstDemo&lt;\/mainClass&gt; &lt;\/transformer&gt; &lt;\/transformers&gt; &lt;\/configuration&gt; &lt;\/execution&gt; &lt;\/executions&gt; &lt;\/plugin&gt; &lt;\/plugins&gt; &lt;\/build&gt; &lt;\/project&gt; \u8868 1 -2 Maven \u7f16\u8bd1\u547d\u4ee4 \u547d \u4ee4 \u542b \u4e49 mvn clean \u6e05\u7406\u7f16\u8bd1\u7ed3\u679c mvn compile [-Pnative] \u7f16\u8bd1\u6e90\u4ee3\u7801 mvn test [-Pnative] \u8fd0\u884c\u6d4b\u8bd5\u7a0b\u5e8f mvn package \u521b\u5efa JAR \u5305 mvn compile findbugs:findbugs \u8fd0\u884c findbugs mvn compile checkstyle:checkstyle \u8fd0\u884c checkstyle\uff08 \u68c0\u67e5\u7f16\u7a0b\u89c4\u8303\uff09 mvn install \u5c06 JAR \u5305\u653e\u5230 M2 \u7f13\u5b58\u4e2d mvn deploy \u5c06 JAR \u90e8\u7f72\u5230 Maven \u4ed3\u5e93\u4e2d mvn package [-Pdist][-Pdocs][-Psrc][-Pnative][-Dtar] \u6784\u5efa\u53d1\u5e03\u7248 mvn versions:set -DnewVersion=NEWVERSION \u4fee\u6539 Hadoop \u7248\u672c<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","footnotes":""},"categories":[85],"tags":[],"class_list":["post-1445","post","type-post","status-publish","format-standard","hentry","category-hadoop"],"_links":{"self":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1445"}],"version-history":[{"count":1,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1445\/revisions"}],"predecessor-version":[{"id":1446,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1445\/revisions\/1446"}],"wp:attachment":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}