{"id":913,"date":"2011-03-29T13:25:58","date_gmt":"2011-03-29T21:25:58","guid":{"rendered":"http:\/\/technofovea.com\/blog\/?p=913"},"modified":"2016-03-31T23:34:20","modified_gmt":"2016-04-01T06:34:20","slug":"maven-repository-on-github","status":"publish","type":"post","link":"http:\/\/technofovea.com\/blog\/archives\/913","title":{"rendered":"Maven repository on Github"},"content":{"rendered":"<p>I&#8217;ve been spending some time updating maven build-scripts, making test-code more portable, and even added a maven repository on my github account.<\/p>\n<p>The problem with &#8220;Maven Repositories&#8221; it is not always clear what is the minimum needed to distribute code versus what kind of management\/proxy server software that someone wants to sell you. The minimum you need is really just a file structure!<\/p>\n<p><!--more--><\/p>\n<p>Using <a href=\"http:\/\/pages.github.com\/\">gh-pages<\/a> and basics <a href=\"http:\/\/chkal.blogspot.com\/2010\/09\/maven-repositories-on-github.html\">from this blog post<\/a>, I created a maven-repository (file structure) inside a git-repository (source control) which has both the <a href=\"http:\/\/github.com\/dhager\/mvn-repo\/\">normal github homepage<\/a> as well as a <a href=\"http:\/\/dhager.github.com\/mvn-repo\/\">custom one<\/a> (through the gh-pages branch).<\/p>\n<p>The upshot of this is that I can easily provide stable binary releases of libraries.<\/p>\n<p>The basic steps are:<\/p>\n<ol>\n<li>Find a new or existing github repository that does not yet have a &#8220;gh-pages&#8221; branch<\/li>\n<li>Check it out to a directory, and run a few magic git commands<\/li>\n<li>Create a gh-pages branch, fill it with any web pages you want.<\/li>\n<li>Have your build scripts do a maven &#8220;deploy&#8221; goal into that directory (via a file:\/\/ url)<\/li>\n<li>Commit and push the changes so that they are available through github pages<\/li>\n<li>Add a custom repository (http url) to your projects matching the github pages<\/li>\n<\/ol>\n<p>Github pages do not show directory listings, so you have to manually build the index.html files yourself if you want your maven repository to be explorable with a web browser. I decided to write my own script to accomplish this which is available <a href=\"https:\/\/github.com\/DHager\/mvn-repo\/blob\/gh-pages\/update-directory-index.py\">here<\/a>. It uses python to build index.html pages. (I may remove the time-stamps since it adds to the visual overhead of git commits.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been spending some time updating maven build-scripts, making test-code more portable, and even added a maven repository on my github account. The problem with &#8220;Maven Repositories&#8221; it is not always clear what is the minimum needed to distribute code versus what kind of management\/proxy server software that someone wants to sell you. The minimum [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[23,17,7,8],"_links":{"self":[{"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/posts\/913"}],"collection":[{"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/comments?post=913"}],"version-history":[{"count":7,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/posts\/913\/revisions"}],"predecessor-version":[{"id":1028,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/posts\/913\/revisions\/1028"}],"wp:attachment":[{"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/media?parent=913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/categories?post=913"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/technofovea.com\/blog\/wp-json\/wp\/v2\/tags?post=913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}