{"id":2107,"date":"2012-10-03T22:00:00","date_gmt":"2012-10-03T22:00:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html"},"modified":"2012-10-22T14:53:31","modified_gmt":"2012-10-22T14:53:31","slug":"maven-build-number-plugin-sample-usage","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html","title":{"rendered":"Maven Build Number Plugin &#8211; Sample Usage"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">Suppose we need to add a build number to some artifact (jar, war, etc.). Here I&#8217;d like to demonstrate the usage of                     <a href=\"http:\/\/mojo.codehaus.org\/buildnumber-maven-plugin\" target=\"_blank\">buildnumber-maven-plugin<\/a>.<\/p>\n<p>This post is based on:                    <\/p>\n<ul>\n<li><a href=\"http:\/\/mojo.codehaus.org\/buildnumber-maven-plugin\/usage.html\">http:\/\/mojo.codehaus.org\/buildnumber-maven-plugin\/usage.html<\/a><\/li>\n<li><a href=\"http:\/\/www.site.lalitbhatt.com\/maven-build-number-plugin\">http:\/\/www.site.lalitbhatt.com\/maven-build-number-plugin<\/a><\/li>\n<li><a href=\"http:\/\/blog.peterlynch.ca\/2009\/11\/buildnumber-maven-plugin-helpful.html\">http:\/\/blog.peterlynch.ca\/2009\/11\/buildnumber-maven-plugin-helpful.html<\/a><\/li>\n<li><a href=\"http:\/\/apollo.ucalgary.ca\/tlcprojectswiki\/index.php\/Public\/Project_Versioning_-_Best_Practices#Build_Versioning\">http:\/\/apollo.ucalgary.ca\/tlcprojectswiki\/index.php\/Public\/Project_Versioning_-_Best_Practices#Build_Versioning<\/a><\/li>\n<\/ul>\n<p>We have some project and need to include into jar manifest file sequential build number which isn&#8217;t based on VCS (SVN, Git, Mercurial, etc.) revision number. Let&#8217;s create appropriate                     pom.xml file and implement small demo to verify the result.                    <\/p>\n<p>Generate maven project                    <\/p>\n<pre class=\"brush:bash\">$ mvn archetype:generate -DgroupId=org.halyph -DartifactId=buildNoTest\\\r\n-DarchetypeArtifactId=maven-archetype-quickstart \\\r\n-DinteractiveMode=false<\/pre>\n<p>Create the pom.xml                    <\/p>\n<pre class=\"brush:xml\">&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:schemalocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/maven-v4_0_0.xsd\"&gt;\r\n &lt;modelversion&gt;4.0.0&lt;\/modelversion&gt;\r\n &lt;groupid&gt;org.halyph&lt;\/groupid&gt;\r\n &lt;artifactid&gt;buildNoTest&lt;\/artifactid&gt;\r\n &lt;packaging&gt;jar&lt;\/packaging&gt;\r\n &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;\r\n &lt;name&gt;buildNoTest&lt;\/name&gt;\r\n &lt;url&gt;http:\/\/maven.apache.org&lt;\/url&gt;\r\n \r\n &lt;dependencies&gt;\r\n  &lt;dependency&gt;\r\n   &lt;groupid&gt;junit&lt;\/groupid&gt;\r\n   &lt;artifactid&gt;junit&lt;\/artifactid&gt;\r\n   &lt;version&gt;3.8.1&lt;\/version&gt;\r\n   &lt;scope&gt;test&lt;\/scope&gt;\r\n  &lt;\/dependency&gt;\r\n &lt;\/dependencies&gt;\r\n \r\n &lt;properties&gt;\r\n  &lt;project.build.sourceencoding&gt;UTF-8&lt;\/project.build.sourceencoding&gt;\r\n &lt;\/properties&gt;\r\n \r\n &lt;!-- \r\n If you have access to scm then you can place actual url's. \r\n Otherwise with &lt;revisionOnScmFailure \/&gt; you can give some fake URLs as follows. \r\n --&gt;\r\n &lt;scm&gt;\r\n  &lt;connection&gt;scm:svn:http:\/\/none&lt;\/connection&gt;\r\n  &lt;developerconnection&gt;scm:svn:https:\/\/none&lt;\/developerconnection&gt;\r\n  &lt;url&gt;scm:svn:https:\/\/none&lt;\/url&gt;\r\n &lt;\/scm&gt;\r\n \r\n &lt;build&gt;\r\n  &lt;resources&gt;\r\n   &lt;resource&gt;\r\n    &lt;directory&gt;src\/main\/resources&lt;\/directory&gt;\r\n   &lt;\/resource&gt;\r\n   &lt;resource&gt;\r\n    &lt;directory&gt;src\/main\/filtered-resources&lt;\/directory&gt;\r\n    &lt;filtering&gt;true&lt;\/filtering&gt;\r\n   &lt;\/resource&gt;\r\n  &lt;\/resources&gt;\r\n  &lt;plugins&gt;\r\n   &lt;plugin&gt;\r\n    &lt;groupid&gt;org.codehaus.mojo&lt;\/groupid&gt;\r\n    &lt;artifactid&gt;buildnumber-maven-plugin&lt;\/artifactid&gt;\r\n    &lt;version&gt;1.1&lt;\/version&gt;\r\n    &lt;executions&gt;\r\n     &lt;execution&gt;\r\n      &lt;phase&gt;generate-resources&lt;\/phase&gt;\r\n      &lt;goals&gt;\r\n       &lt;goal&gt;create&lt;\/goal&gt;\r\n      &lt;\/goals&gt;\r\n     &lt;\/execution&gt;\r\n    &lt;\/executions&gt;\r\n    &lt;configuration&gt;\r\n     &lt;!-- \r\n      doCheck and doUpdate actually talk to repository if it's true,\r\n      Check would check that there are no local changes. \r\n      Update would update it \r\n     --&gt;\r\n     &lt;docheck&gt;false&lt;\/docheck&gt;\r\n     &lt;doupdate&gt;false&lt;\/doupdate&gt;\r\n     &lt;!-- \r\n      This ensures that even if we are not connected to scm than also\r\n      take the version from local .svn file \r\n     --&gt;\r\n     &lt;revisiononscmfailure&gt;\r\n      \r\n     &lt;!--\r\n      Generate sequence build number based on:\r\n      build number and timestamp      \r\n     --&gt;\r\n     &lt;format&gt;Build: #{0} ({1,date})&lt;\/format&gt;\r\n     &lt;items&gt;\r\n      &lt;item&gt;buildNumber\\d*&lt;\/item&gt;\r\n      &lt;item&gt;timestamp&lt;\/item&gt;\r\n     &lt;\/items&gt;\r\n    &lt;\/revisiononscmfailure&gt;&lt;\/configuration&gt;\r\n   &lt;\/plugin&gt;\r\n   &lt;plugin&gt;\r\n    &lt;groupid&gt;org.apache.maven.plugins&lt;\/groupid&gt;\r\n    &lt;artifactid&gt;maven-jar-plugin&lt;\/artifactid&gt;\r\n    &lt;version&gt;2.1&lt;\/version&gt;\r\n    &lt;configuration&gt;\r\n     &lt;archive&gt;\r\n      &lt;!-- will put the entries into META-INF\/MANIFEST.MF file --&gt;\r\n      &lt;manifestentries&gt;\r\n       &lt;implementation-version&gt;${project.version}&lt;\/implementation-version&gt;\r\n       &lt;implementation-build&gt;${buildNumber}&lt;\/implementation-build&gt;\r\n      &lt;\/manifestentries&gt;\r\n     &lt;\/archive&gt;\r\n    &lt;\/configuration&gt;\r\n   &lt;\/plugin&gt;\r\n  &lt;\/plugins&gt;\r\n &lt;\/build&gt;\r\n&lt;\/project&gt;\r\n<\/pre>\n<p>Create demo application to verify the results                     <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush:java\">package org.halyph;\r\n\r\nimport java.io.IOException;\r\nimport java.util.ResourceBundle;\r\nimport java.util.jar.Attributes;\r\nimport java.util.jar.Manifest;\r\n\r\npublic class App\r\n{\r\n    public static void main( String[] args ) throws IOException\r\n    {\r\n        System.out.println('Verify Resource bundle' );\r\n  \r\n \/\/ Check filtered resources based on generated build number\r\n        ResourceBundle bundle = ResourceBundle.getBundle( 'build' );\r\n        String msg = bundle.getString( 'build.message' );\r\n        System.out.println(msg);\r\n\r\n        System.out.println('\\nVerify Generated MANIFEST.MF Properties' );\r\n\r\n \/\/ Check Manifest file based on generated build number\r\n        Manifest mf = new Manifest();\r\n        mf.read(Thread.currentThread().getContextClassLoader().getResourceAsStream('META-INF\/MANIFEST.MF'));\r\n\r\n        Attributes atts = mf.getMainAttributes();\r\n\r\n        System.out.println('Implementation-Versio: ' + atts.getValue('Implementation-Version'));\r\n        System.out.println('Implementation-Build: ' + atts.getValue('Implementation-Build'));\r\n    }\r\n}\r\n<\/pre>\n<p>Build                     application several time                     and Run                     <\/p>\n<pre class=\"brush:bash\">$ mvn install <\/pre>\n<pre class=\"brush:bash\">$ java -cp target\\buildNoTest-1.0-SNAPSHOT.jar org.halyph.App\r\nVerify Resource bundle\r\nBuild: #3 (Jun 27, 2012)\r\n\r\nVerify Generated MANIFEST.MF Properties\r\nImplementation-Versio: 1.0-SNAPSHOT\r\nImplementation-Build: Build: #3 (Jun 27, 2012)\r\n<\/pre>\n<p><strong>Summary                    <\/strong><\/p>\n<ol>\n<li>We should inform <a href=\"http:\/\/mojo.codehaus.org\/buildnumber-maven-plugin\" target=\"_blank\">buildnumber-maven-plugin<\/a> that we won&#8217;t use version control revision as build number via adding fake &lt;scm&gt; section into pom.xml and &lt;revisionOnScmFailure \/&gt; into buildnumber-maven-plugin &lt;configuration&gt;<\/li>\n<li>Implemented custom build number format, see buildnumber-maven-plugin &lt;configuration&gt;\/&lt;format&gt; and &lt;configuration&gt;\/&lt;items&gt;.<\/li>\n<li>Added build number into jar manifest, see maven-jar-plugin pom.xml section <\/li>\n<li>Tested if generated build number can be properly added in filtered resources<\/li>\n<ul>\n<li>created src\\main\\filtered-resources\\build.properties file<\/li>\n<pre class=\"brush:bash\">build.message=${buildNumber}\r\n<\/pre>\n<li>added resource filtering, see section &lt;resource&gt; flag &lt;filtering&gt;true&lt;\/filtering&gt;<\/li>\n<\/ul>\n<li>Demo application verifying the filtered resources and build number in jar manifest file<\/li>\n<\/ol>\n<p>You can git clone this project                     <a href=\"https:\/\/github.com\/halyph\/blog-sandbox\/tree\/master\/Maven\/blogpost_062712\">https:\/\/github.com\/halyph\/blog-sandbox\/tree\/master\/Maven\/blogpost_062712<\/a><\/p>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/halyph.blogspot.gr\/2012\/06\/maven-build-number-plugin-sample-usage.html\">Maven Build Number Plugin &#8211; Sample Usage<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Orest Ivasiv at the <a href=\"http:\/\/halyph.blogspot.gr\/\">Knowledge Is Everything<\/a> blog.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Suppose we need to add a build number to some artifact (jar, war, etc.). Here I&#8217;d like to demonstrate the usage of buildnumber-maven-plugin. This post is based on: http:\/\/mojo.codehaus.org\/buildnumber-maven-plugin\/usage.html http:\/\/www.site.lalitbhatt.com\/maven-build-number-plugin http:\/\/blog.peterlynch.ca\/2009\/11\/buildnumber-maven-plugin-helpful.html http:\/\/apollo.ucalgary.ca\/tlcprojectswiki\/index.php\/Public\/Project_Versioning_-_Best_Practices#Build_Versioning We have some project and need to include into jar manifest file sequential build number which isn&#8217;t based on VCS (SVN, Git, Mercurial, &hellip;<\/p>\n","protected":false},"author":291,"featured_media":73,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[68],"class_list":["post-2107","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-maven"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Maven Build Number Plugin - Sample Usage - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Suppose we need to add a build number to some artifact (jar, war, etc.). Here I&#039;d like to demonstrate the usage of buildnumber-maven-plugin. This post is\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Maven Build Number Plugin - Sample Usage - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Suppose we need to add a build number to some artifact (jar, war, etc.). Here I&#039;d like to demonstrate the usage of buildnumber-maven-plugin. This post is\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2012-10-03T22:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-22T14:53:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Orest Ivasiv\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/halyph\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Orest Ivasiv\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html\"},\"author\":{\"name\":\"Orest Ivasiv\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/c70ad63c956aac298d37718e4c9b7f00\"},\"headline\":\"Maven Build Number Plugin &#8211; Sample Usage\",\"datePublished\":\"2012-10-03T22:00:00+00:00\",\"dateModified\":\"2012-10-22T14:53:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html\"},\"wordCount\":281,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"keywords\":[\"Apache Maven\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html\",\"name\":\"Maven Build Number Plugin - Sample Usage - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"datePublished\":\"2012-10-03T22:00:00+00:00\",\"dateModified\":\"2012-10-22T14:53:31+00:00\",\"description\":\"Suppose we need to add a build number to some artifact (jar, war, etc.). Here I'd like to demonstrate the usage of buildnumber-maven-plugin. This post is\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/10\\\/maven-build-number-plugin-sample-usage.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Maven Build Number Plugin &#8211; Sample Usage\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/c70ad63c956aac298d37718e4c9b7f00\",\"name\":\"Orest Ivasiv\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0ac95246a0ede5433a8e7758205a09b3e20ed9778f3d46dc790d36ac3ea07932?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0ac95246a0ede5433a8e7758205a09b3e20ed9778f3d46dc790d36ac3ea07932?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0ac95246a0ede5433a8e7758205a09b3e20ed9778f3d46dc790d36ac3ea07932?s=96&d=mm&r=g\",\"caption\":\"Orest Ivasiv\"},\"description\":\"Passionate software engineer interested in different programming languages, pragmatic approaches and performance boost practices.\",\"sameAs\":[\"http:\\\/\\\/halyph.blogspot.com\\\/\",\"http:\\\/\\\/www.linkedin.com\\\/in\\\/oivasiv\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/halyph\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Orest-Ivasiv\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Maven Build Number Plugin - Sample Usage - Java Code Geeks","description":"Suppose we need to add a build number to some artifact (jar, war, etc.). Here I'd like to demonstrate the usage of buildnumber-maven-plugin. This post is","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:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html","og_locale":"en_US","og_type":"article","og_title":"Maven Build Number Plugin - Sample Usage - Java Code Geeks","og_description":"Suppose we need to add a build number to some artifact (jar, war, etc.). Here I'd like to demonstrate the usage of buildnumber-maven-plugin. This post is","og_url":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-10-03T22:00:00+00:00","article_modified_time":"2012-10-22T14:53:31+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","type":"image\/jpeg"}],"author":"Orest Ivasiv","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/halyph","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Orest Ivasiv","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html"},"author":{"name":"Orest Ivasiv","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/c70ad63c956aac298d37718e4c9b7f00"},"headline":"Maven Build Number Plugin &#8211; Sample Usage","datePublished":"2012-10-03T22:00:00+00:00","dateModified":"2012-10-22T14:53:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html"},"wordCount":281,"commentCount":1,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","keywords":["Apache Maven"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html","url":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html","name":"Maven Build Number Plugin - Sample Usage - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","datePublished":"2012-10-03T22:00:00+00:00","dateModified":"2012-10-22T14:53:31+00:00","description":"Suppose we need to add a build number to some artifact (jar, war, etc.). Here I'd like to demonstrate the usage of buildnumber-maven-plugin. This post is","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/10\/maven-build-number-plugin-sample-usage.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Maven Build Number Plugin &#8211; Sample Usage"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/c70ad63c956aac298d37718e4c9b7f00","name":"Orest Ivasiv","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0ac95246a0ede5433a8e7758205a09b3e20ed9778f3d46dc790d36ac3ea07932?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0ac95246a0ede5433a8e7758205a09b3e20ed9778f3d46dc790d36ac3ea07932?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0ac95246a0ede5433a8e7758205a09b3e20ed9778f3d46dc790d36ac3ea07932?s=96&d=mm&r=g","caption":"Orest Ivasiv"},"description":"Passionate software engineer interested in different programming languages, pragmatic approaches and performance boost practices.","sameAs":["http:\/\/halyph.blogspot.com\/","http:\/\/www.linkedin.com\/in\/oivasiv","https:\/\/x.com\/http:\/\/twitter.com\/halyph"],"url":"https:\/\/www.javacodegeeks.com\/author\/Orest-Ivasiv"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/2107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/291"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=2107"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/2107\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/73"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=2107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=2107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=2107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}