{"id":292,"date":"2008-10-08T08:12:47","date_gmt":"2008-10-08T07:12:47","guid":{"rendered":"http:\/\/thekua.com\/atwork\/2008\/10\/08\/maven-assembly-plugin-ignoring-manifestentries\/"},"modified":"2019-07-25T10:13:35","modified_gmt":"2019-07-25T08:13:35","slug":"maven-assembly-plugin-ignoring-manifestentries","status":"publish","type":"post","link":"https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/","title":{"rendered":"Maven-assembly-plugin ignoring manifestEntries?"},"content":{"rendered":"<p>We&#8217;re using <a href=\"http:\/\/maven.apache.org\/plugins\/maven-assembly-plugin\/\">this Maven plugin<\/a> to generate a fat jar for a utility, effectively including all library dependencies un-jarred and re-jarred into a single distribution. The first part was easy, hooking the <strong>assembly<\/strong> goal of the maven-assembly-plugin onto the <strong>package<\/strong> goal in the maven build lifecycle. Our pom.xml had this entry in it<\/p>\n<pre>&lt;plugin&gt;\n  &lt;artifactId&gt;maven-assembly-plugin&lt;\/artifactId&gt;\n  &lt;configuration&gt;\n    &lt;descriptorRefs&gt;\n      &lt;descriptorRef&gt;jar-with-dependencies&lt;\/descriptorRef&gt;\n    &lt;\/descriptorRefs&gt;\n    &lt;archive&gt;\n      &lt;manifest&gt;\n        &lt;mainClass&gt;com.thekua.maven.ExampleProgram&lt;\/mainClass&gt;\n      &lt;\/manifest&gt;\n    &lt;\/archive&gt;\n  &lt;\/configuration&gt;\n  &lt;executions&gt;\n    &lt;execution&gt;\n      &lt;phase&gt;package&lt;\/phase&gt;\n      &lt;goals&gt;&lt;goal&gt;assembly&lt;\/goal&gt;&lt;\/goals&gt;\n    &lt;\/execution&gt;\n  &lt;\/executions&gt;\n&lt;\/plugin&gt;<\/pre>\n<p>We tried adding in our own entry into the manifest, the CruisePipelineLabel, with a value that should be set by <a href=\"http:\/\/studios.thoughtworks.com\/cruise\">Cruise<\/a>. We added the new section so our pom.xml now looked like this:<\/p>\n<pre>&lt;plugin&gt;\n  &lt;artifactId&gt;maven-assembly-plugin&lt;\/artifactId&gt;\n  &lt;configuration&gt;\n    &lt;descriptorRefs&gt;\n      &lt;descriptorRef&gt;jar-with-dependencies&lt;\/descriptorRef&gt;\n    &lt;\/descriptorRefs&gt;\n    &lt;archive&gt;\n      &lt;manifest&gt;&lt;mainClass&gt;com.thekua.maven.ExampleProgram&lt;\/mainClass&gt;&lt;\/manifest&gt;\n<strong>        &lt;manifestEntries&gt;\n          &lt;CruisePipelineLabel&gt;\n            ${env.CRUISE_PIPELINE_LABEL}\n          &lt;\/CruisePipelineLabel&gt;\n        &lt;\/manifestEntries&gt;\n<\/strong>    &lt;\/archive&gt;\n  &lt;\/configuration&gt;\n  &lt;executions&gt;\n    &lt;execution&gt;\n      &lt;phase&gt;package&lt;\/phase&gt;\n      &lt;goals&gt;&lt;goal&gt;assembly&lt;\/goal&gt;&lt;\/goals&gt;\n    &lt;\/execution&gt;\n  &lt;\/executions&gt;\n&lt;\/plugin&gt;<\/pre>\n<p>After running the target and inspecting the manifest.mf, I couldn&#8217;t see the additional property set. I did some searching, found a bug apparently fixed in the 2.2-beta-2 version. After some debugging, I found out that the plugin apparently does not include these additional entries if the value is not set. I tested this out by changing the line to:<\/p>\n<pre>&lt;manifestEntries&gt;\n  &lt;CruisePipelineLabel&gt;aTestValue&lt;\/CruisePipelineLabel&gt;\n&lt;\/manifestEntries&gt;\n<\/pre>\n<p>So the answer to whether or not maven-assembly-plugin ignores an element in the manifestEntries is to ensure the value is set before testing it. It looks like a null value is interpreted as &#8220;don&#8217;t include&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re using this Maven plugin to generate a fat jar for a utility, effectively including all library dependencies un-jarred and re-jarred into a single distribution. The first part was easy, hooking the assembly goal of the maven-assembly-plugin onto the package goal in the maven build lifecycle. Our pom.xml had this entry in it &lt;plugin&gt; &lt;artifactId&gt;maven-assembly-plugin&lt;\/artifactId&gt; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,35],"tags":[],"class_list":["post-292","post","type-post","status-publish","format-standard","hentry","category-development","category-java","post-preview"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Maven-assembly-plugin ignoring manifestEntries? - patkua@work<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Maven-assembly-plugin ignoring manifestEntries? - patkua@work\" \/>\n<meta property=\"og:description\" content=\"We&#8217;re using this Maven plugin to generate a fat jar for a utility, effectively including all library dependencies un-jarred and re-jarred into a single distribution. The first part was easy, hooking the assembly goal of the maven-assembly-plugin onto the package goal in the maven build lifecycle. Our pom.xml had this entry in it &lt;plugin&gt; &lt;artifactId&gt;maven-assembly-plugin&lt;\/artifactId&gt; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/\" \/>\n<meta property=\"og:site_name\" content=\"patkua@work\" \/>\n<meta property=\"article:published_time\" content=\"2008-10-08T07:12:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-25T08:13:35+00:00\" \/>\n<meta name=\"author\" content=\"Patrick\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@patkua\" \/>\n<meta name=\"twitter:site\" content=\"@patkua\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Patrick\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2008\\\/10\\\/maven-assembly-plugin-ignoring-manifestentries\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2008\\\/10\\\/maven-assembly-plugin-ignoring-manifestentries\\\/\"},\"author\":{\"name\":\"Patrick\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#\\\/schema\\\/person\\\/c942203c9ed3ff9e21c6c49a996ea3ae\"},\"headline\":\"Maven-assembly-plugin ignoring manifestEntries?\",\"datePublished\":\"2008-10-08T07:12:47+00:00\",\"dateModified\":\"2019-07-25T08:13:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2008\\\/10\\\/maven-assembly-plugin-ignoring-manifestentries\\\/\"},\"wordCount\":189,\"commentCount\":0,\"articleSection\":[\"Development\",\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thekua.com\\\/atwork\\\/2008\\\/10\\\/maven-assembly-plugin-ignoring-manifestentries\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2008\\\/10\\\/maven-assembly-plugin-ignoring-manifestentries\\\/\",\"url\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2008\\\/10\\\/maven-assembly-plugin-ignoring-manifestentries\\\/\",\"name\":\"Maven-assembly-plugin ignoring manifestEntries? - patkua@work\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#website\"},\"datePublished\":\"2008-10-08T07:12:47+00:00\",\"dateModified\":\"2019-07-25T08:13:35+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#\\\/schema\\\/person\\\/c942203c9ed3ff9e21c6c49a996ea3ae\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2008\\\/10\\\/maven-assembly-plugin-ignoring-manifestentries\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thekua.com\\\/atwork\\\/2008\\\/10\\\/maven-assembly-plugin-ignoring-manifestentries\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/2008\\\/10\\\/maven-assembly-plugin-ignoring-manifestentries\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Maven-assembly-plugin ignoring manifestEntries?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#website\",\"url\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/\",\"name\":\"patkua@work\",\"description\":\"The intersection of technology and leadership\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/#\\\/schema\\\/person\\\/c942203c9ed3ff9e21c6c49a996ea3ae\",\"name\":\"Patrick\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g\",\"caption\":\"Patrick\"},\"sameAs\":[\"http:\\\/\\\/thekua.com\\\/atwork\"],\"url\":\"https:\\\/\\\/thekua.com\\\/atwork\\\/author\\\/patrick\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Maven-assembly-plugin ignoring manifestEntries? - patkua@work","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/","og_locale":"en_US","og_type":"article","og_title":"Maven-assembly-plugin ignoring manifestEntries? - patkua@work","og_description":"We&#8217;re using this Maven plugin to generate a fat jar for a utility, effectively including all library dependencies un-jarred and re-jarred into a single distribution. The first part was easy, hooking the assembly goal of the maven-assembly-plugin onto the package goal in the maven build lifecycle. Our pom.xml had this entry in it &lt;plugin&gt; &lt;artifactId&gt;maven-assembly-plugin&lt;\/artifactId&gt; [&hellip;]","og_url":"https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/","og_site_name":"patkua@work","article_published_time":"2008-10-08T07:12:47+00:00","article_modified_time":"2019-07-25T08:13:35+00:00","author":"Patrick","twitter_card":"summary_large_image","twitter_creator":"@patkua","twitter_site":"@patkua","twitter_misc":{"Written by":"Patrick","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/#article","isPartOf":{"@id":"https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/"},"author":{"name":"Patrick","@id":"https:\/\/thekua.com\/atwork\/#\/schema\/person\/c942203c9ed3ff9e21c6c49a996ea3ae"},"headline":"Maven-assembly-plugin ignoring manifestEntries?","datePublished":"2008-10-08T07:12:47+00:00","dateModified":"2019-07-25T08:13:35+00:00","mainEntityOfPage":{"@id":"https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/"},"wordCount":189,"commentCount":0,"articleSection":["Development","Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/","url":"https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/","name":"Maven-assembly-plugin ignoring manifestEntries? - patkua@work","isPartOf":{"@id":"https:\/\/thekua.com\/atwork\/#website"},"datePublished":"2008-10-08T07:12:47+00:00","dateModified":"2019-07-25T08:13:35+00:00","author":{"@id":"https:\/\/thekua.com\/atwork\/#\/schema\/person\/c942203c9ed3ff9e21c6c49a996ea3ae"},"breadcrumb":{"@id":"https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/thekua.com\/atwork\/2008\/10\/maven-assembly-plugin-ignoring-manifestentries\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thekua.com\/atwork\/"},{"@type":"ListItem","position":2,"name":"Maven-assembly-plugin ignoring manifestEntries?"}]},{"@type":"WebSite","@id":"https:\/\/thekua.com\/atwork\/#website","url":"https:\/\/thekua.com\/atwork\/","name":"patkua@work","description":"The intersection of technology and leadership","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thekua.com\/atwork\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/thekua.com\/atwork\/#\/schema\/person\/c942203c9ed3ff9e21c6c49a996ea3ae","name":"Patrick","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2ef85a5f91c2aac13efb3ac90077b4db7f8883cafd6e60f2bcecba6b092d4011?s=96&d=mm&r=g","caption":"Patrick"},"sameAs":["http:\/\/thekua.com\/atwork"],"url":"https:\/\/thekua.com\/atwork\/author\/patrick\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/comments?post=292"}],"version-history":[{"count":1,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts\/292\/revisions"}],"predecessor-version":[{"id":3464,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/posts\/292\/revisions\/3464"}],"wp:attachment":[{"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/media?parent=292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/categories?post=292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thekua.com\/atwork\/wp-json\/wp\/v2\/tags?post=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}