[{"data":1,"prerenderedAt":527},["ShallowReactive",2],{"Categories":3,"NavIndexCategoriesCountFooter":203,"content-\u002F2009\u002F09\u002F05\u002Fusing-maven-exec-plugin-to-store-the-current-git-sha-in-a-build\u002F":204},[4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,70,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202],{"category":5},"System Administration",{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},"Software Development",{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":27},{"category":27},{"category":67},"Drones & RC",{"category":69},"DIY Projects",{"category":67},{"category":72},"Photography",{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":67},{"category":67},{"category":72},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":5},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":67},{"category":67},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":72},{"category":67},{"category":138},"3D Printing - Laser Cutting - CNC",{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":5},{"category":138},{"category":27},{"category":27},{"category":138},{"category":138},{"category":72},{"category":158},"Photography,3D Printing - Laser Cutting - CNC",{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":67},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":181},"Home Assistant",{"category":181},{"category":72},{"category":27},{"category":27},{"category":72},{"category":138},{"category":5},{"category":72},{"category":72},{"category":138},{"category":27},{"category":181},{"category":181},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},191,{"id":205,"title":206,"body":207,"category":27,"date":512,"description":213,"embedImage":513,"extension":514,"image":513,"intro":513,"meta":515,"navigation":516,"path":517,"seo":518,"series":513,"sitemap":519,"stem":520,"tags":521,"__hash__":526},"content\u002F2009\u002F09\u002F05\u002Fusing-maven-exec-plugin-to-store-the-current-git-sha-in-a-build.md","Using maven-exec-plugin to store the current git sha in a build",{"type":208,"value":209,"toc":510},"minimark",[210,214,217,503,506],[211,212,213],"p",{},"The current version of the maven buildnumber plugin does not yet support the git scm backend. This makes it harder to get the git sha for the current build (often a snapshot build) into the MANIFEST.MF file.",[211,215,216],{},"However - if all you need is a file somewhere in the deployed artifact that contains the sha then this workaround may help until the git scm is supported by buildnumber:",[218,219,224],"pre",{"className":220,"code":221,"language":222,"meta":223,"style":223},"language-xml shiki shiki-themes github-dark","    \u003Cplugin>\n        \u003CgroupId>org.codehaus.mojo\u003C\u002FgroupId>\n        \u003CartifactId>exec-maven-plugin\u003C\u002FartifactId>\n        \u003Cversion>1.1\u003C\u002Fversion>\n        \u003Cexecutions>\n            \u003Cexecution>\n                \u003Cphase>compile\u003C\u002Fphase>\n                \u003Cgoals>\n                    \u003Cgoal>exec\u003C\u002Fgoal>\n                \u003C\u002Fgoals>\n            \u003C\u002Fexecution>\n        \u003C\u002Fexecutions>\n        \u003Cconfiguration>\n            \u003Cexecutable>git\u003C\u002Fexecutable>\n            \u003Carguments>\n                \u003Cargument>log\u003C\u002Fargument>\n                \u003Cargument>--pretty=format:%H\u003C\u002Fargument>\n                \u003Cargument>-n1\u003C\u002Fargument>\n            \u003C\u002Farguments>\n            \u003CoutputFile>target\u002Fclasses\u002Fgitsha.txt\u003C\u002FoutputFile>\n        \u003C\u002Fconfiguration>\n    \u003C\u002Fplugin>\n","xml","",[225,226,227,243,259,274,289,299,310,326,336,352,362,372,382,392,407,417,432,446,460,469,484,493],"code",{"__ignoreMap":223},[228,229,232,236,240],"span",{"class":230,"line":231},"line",1,[228,233,235],{"class":234},"s95oV","    \u003C",[228,237,239],{"class":238},"s4JwU","plugin",[228,241,242],{"class":234},">\n",[228,244,246,249,252,255,257],{"class":230,"line":245},2,[228,247,248],{"class":234},"        \u003C",[228,250,251],{"class":238},"groupId",[228,253,254],{"class":234},">org.codehaus.mojo\u003C\u002F",[228,256,251],{"class":238},[228,258,242],{"class":234},[228,260,262,264,267,270,272],{"class":230,"line":261},3,[228,263,248],{"class":234},[228,265,266],{"class":238},"artifactId",[228,268,269],{"class":234},">exec-maven-plugin\u003C\u002F",[228,271,266],{"class":238},[228,273,242],{"class":234},[228,275,277,279,282,285,287],{"class":230,"line":276},4,[228,278,248],{"class":234},[228,280,281],{"class":238},"version",[228,283,284],{"class":234},">1.1\u003C\u002F",[228,286,281],{"class":238},[228,288,242],{"class":234},[228,290,292,294,297],{"class":230,"line":291},5,[228,293,248],{"class":234},[228,295,296],{"class":238},"executions",[228,298,242],{"class":234},[228,300,302,305,308],{"class":230,"line":301},6,[228,303,304],{"class":234},"            \u003C",[228,306,307],{"class":238},"execution",[228,309,242],{"class":234},[228,311,313,316,319,322,324],{"class":230,"line":312},7,[228,314,315],{"class":234},"                \u003C",[228,317,318],{"class":238},"phase",[228,320,321],{"class":234},">compile\u003C\u002F",[228,323,318],{"class":238},[228,325,242],{"class":234},[228,327,329,331,334],{"class":230,"line":328},8,[228,330,315],{"class":234},[228,332,333],{"class":238},"goals",[228,335,242],{"class":234},[228,337,339,342,345,348,350],{"class":230,"line":338},9,[228,340,341],{"class":234},"                    \u003C",[228,343,344],{"class":238},"goal",[228,346,347],{"class":234},">exec\u003C\u002F",[228,349,344],{"class":238},[228,351,242],{"class":234},[228,353,355,358,360],{"class":230,"line":354},10,[228,356,357],{"class":234},"                \u003C\u002F",[228,359,333],{"class":238},[228,361,242],{"class":234},[228,363,365,368,370],{"class":230,"line":364},11,[228,366,367],{"class":234},"            \u003C\u002F",[228,369,307],{"class":238},[228,371,242],{"class":234},[228,373,375,378,380],{"class":230,"line":374},12,[228,376,377],{"class":234},"        \u003C\u002F",[228,379,296],{"class":238},[228,381,242],{"class":234},[228,383,385,387,390],{"class":230,"line":384},13,[228,386,248],{"class":234},[228,388,389],{"class":238},"configuration",[228,391,242],{"class":234},[228,393,395,397,400,403,405],{"class":230,"line":394},14,[228,396,304],{"class":234},[228,398,399],{"class":238},"executable",[228,401,402],{"class":234},">git\u003C\u002F",[228,404,399],{"class":238},[228,406,242],{"class":234},[228,408,410,412,415],{"class":230,"line":409},15,[228,411,304],{"class":234},[228,413,414],{"class":238},"arguments",[228,416,242],{"class":234},[228,418,420,422,425,428,430],{"class":230,"line":419},16,[228,421,315],{"class":234},[228,423,424],{"class":238},"argument",[228,426,427],{"class":234},">log\u003C\u002F",[228,429,424],{"class":238},[228,431,242],{"class":234},[228,433,435,437,439,442,444],{"class":230,"line":434},17,[228,436,315],{"class":234},[228,438,424],{"class":238},[228,440,441],{"class":234},">--pretty=format:%H\u003C\u002F",[228,443,424],{"class":238},[228,445,242],{"class":234},[228,447,449,451,453,456,458],{"class":230,"line":448},18,[228,450,315],{"class":234},[228,452,424],{"class":238},[228,454,455],{"class":234},">-n1\u003C\u002F",[228,457,424],{"class":238},[228,459,242],{"class":234},[228,461,463,465,467],{"class":230,"line":462},19,[228,464,367],{"class":234},[228,466,414],{"class":238},[228,468,242],{"class":234},[228,470,472,474,477,480,482],{"class":230,"line":471},20,[228,473,304],{"class":234},[228,475,476],{"class":238},"outputFile",[228,478,479],{"class":234},">target\u002Fclasses\u002Fgitsha.txt\u003C\u002F",[228,481,476],{"class":238},[228,483,242],{"class":234},[228,485,487,489,491],{"class":230,"line":486},21,[228,488,377],{"class":234},[228,490,389],{"class":238},[228,492,242],{"class":234},[228,494,496,499,501],{"class":230,"line":495},22,[228,497,498],{"class":234},"    \u003C\u002F",[228,500,239],{"class":238},[228,502,242],{"class":234},[211,504,505],{},"This will put a file in the artifact containing the sha. You will need git in your path for this to work.",[507,508,509],"style",{},"html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .s4JwU, html code.shiki .s4JwU{--shiki-default:#85E89D}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":223,"searchDepth":245,"depth":245,"links":511},[],"2009-09-05 11:52:27 +0200",null,"md",{},true,"\u002F2009\u002F09\u002F05\u002Fusing-maven-exec-plugin-to-store-the-current-git-sha-in-a-build",{"title":206,"description":213},{"loc":517},"2009\u002F09\u002F05\u002Fusing-maven-exec-plugin-to-store-the-current-git-sha-in-a-build",[522,523,524,525],"maven","git","buildnumber-maven-plugin","exec-maven-plugin","KyRJCC0u_lYQIQgJyDkitzDuk04vDMJkNMbM3MeIhd8",1775293014194]