{"id":3082,"date":"2020-04-13T18:32:52","date_gmt":"2020-04-13T19:02:52","guid":{"rendered":"https:\/\/ultering.com\/it4us\/?p=3082"},"modified":"2020-08-30T15:59:26","modified_gmt":"2020-08-30T16:29:26","slug":"maven-generating-a-executable-jar","status":"publish","type":"post","link":"https:\/\/ultering.com\/it4us\/?p=3082","title":{"rendered":"MAVEN: GENERATING AN EXECUTABLE JAR"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-white ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a051768dac23\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a051768dac23\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ultering.com\/it4us\/?p=3082\/#1_Setup_configuration\" title=\"1. Setup configuration:\">1. Setup configuration:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ultering.com\/it4us\/?p=3082\/#2_Execute_the_command_below\" title=\"2. Execute the command below.\">2. Execute the command below.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ultering.com\/it4us\/?p=3082\/#3_Check_the_created_file_ended_with_jar-with-dependencies\" title=\"3. Check the created file ended with jar-with-dependencies\">3. Check the created file ended with jar-with-dependencies<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"1_Setup_configuration\"><\/span><span style=\"font-size: 10pt;\">1. Setup configuration:<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\">&lt;plugin&gt;\r\n    &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;maven-assembly-plugin&lt;\/artifactId&gt;\r\n    &lt;executions&gt;\r\n        &lt;execution&gt;\r\n            &lt;phase&gt;package&lt;\/phase&gt;\r\n            &lt;goals&gt;\r\n                &lt;goal&gt;single&lt;\/goal&gt;\r\n            &lt;\/goals&gt;\r\n            &lt;configuration&gt;\r\n                &lt;archive&gt;\r\n                    &lt;manifest&gt;\r\n                        &lt;mainClass&gt;\r\n                            main.ProductionTools\r\n                        &lt;\/mainClass&gt;\r\n                    &lt;\/manifest&gt;\r\n                &lt;\/archive&gt;\r\n                &lt;descriptorRefs&gt;\r\n                    &lt;descriptorRef&gt;jar-with-dependencies&lt;\/descriptorRef&gt;\r\n                &lt;\/descriptorRefs&gt;\r\n            &lt;\/configuration&gt;\r\n        &lt;\/execution&gt;\r\n    &lt;\/executions&gt;\r\n&lt;\/plugin&gt;<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"2_Execute_the_command_below\"><\/span><span style=\"font-size: 10pt;\">2. Execute the command below.<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">mvn clean install<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"3_Check_the_created_file_ended_with_jar-with-dependencies\"><\/span><span style=\"font-size: 10pt;\">3. Check the created file ended with jar-with-dependencies<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Verify the folder, target, for the jar ended with the name &#8220;jar-with-dependencies&#8221;.<\/p>\n<p>&nbsp;<\/p>\n<!--CusAds0-->\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>1. Setup configuration: &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt; &lt;artifactId&gt;maven-assembly-plugin&lt;\/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;package&lt;\/phase&gt; &lt;goals&gt; &lt;goal&gt;single&lt;\/goal&gt; &lt;\/goals&gt; &lt;configuration&gt; &lt;archive&gt; &lt;manifest&gt; &lt;mainClass&gt; main.ProductionTools &lt;\/mainClass&gt; &lt;\/manifest&gt; &lt;\/archive&gt; &lt;descriptorRefs&gt; &lt;descriptorRef&gt;jar-with-dependencies&lt;\/descriptorRef&gt; &lt;\/descriptorRefs&gt; &lt;\/configuration&gt; &lt;\/execution&gt; &lt;\/executions&gt; &lt;\/plugin&gt; 2. Execute the command below. mvn clean install 3. Check the created file ended with jar-with-dependencies Verify the folder, target, for the jar ended with the name &#8220;jar-with-dependencies&#8221;. &#8230; <a href=\"https:\/\/ultering.com\/it4us\/?p=3082\" class=\"more-link\">Read More<span class=\"screen-reader-text\"> &#8220;MAVEN: GENERATING AN EXECUTABLE JAR&#8221;<\/span> &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[12],"tags":[],"class_list":["post-3082","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/3082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3082"}],"version-history":[{"count":7,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/3082\/revisions"}],"predecessor-version":[{"id":4157,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/3082\/revisions\/4157"}],"wp:attachment":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}