{"id":839,"date":"2014-01-21T07:59:41","date_gmt":"2014-01-21T14:59:41","guid":{"rendered":"http:\/\/10kdev.net\/?p=839"},"modified":"2014-01-21T08:11:46","modified_gmt":"2014-01-21T15:11:46","slug":"quick-script-for-switching-maven-settings-or-any-settings","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=839","title":{"rendered":"Quick Script for Switching Maven Settings,<br\/>Or Any Settings"},"content":{"rendered":"<p>Sometimes I&#8217;m on several projects with differing and complicated configs \u00a0for Maven, and use a few different Eclipse\/IDE installs to manage all the preferences between the projects. \u00a0With many different leads can be different Check Style files, PMD rules sets, formatting rules, naming conventions etc. \u00a0Why not just the same standards universally? \u00a0Well, different projects need different things and have different people.<\/p>\n<p>For just the Maven environments, here is a simple Windows batch script I use to switch up the settings. \u00a0Assuming there are two complicated settings.xml files, it prompts for either and copies onto the file name &#8220;settings.xml&#8221; in your .M2 directory.<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@echo off &amp;setlocal\r\n\r\n:COMMANDLOOP\r\necho.\r\necho 1 = Maven settings for Project 1\r\necho 2 = Maven settings for Project 2\r\nset &quot;TEMPCMD=%CD%&quot;\r\nset \/P &quot;TEMPCMD=%CD% :&quot;\r\n\r\nIF &quot;%TEMPCMD%&quot;==&quot;1&quot; (\r\n del settings.xml\r\n copy settings-1.xml settings.xml\r\n ECHO &quot;settings for Project 1 complete&quot;\r\n) ELSE If &quot;%TEMPCMD%&quot;==&quot;2&quot; (\r\n del settings.xml\r\n copy settings-2.xml settings.xml\r\n ECHO &quot;settings for Project 2 complete&quot;\r\n) ELSE (\r\n echo &quot;Please enter 1 or 2. Try again.&quot;\r\n GOTO COMMANDLOOP\r\n)\r\n\r\npause\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes I&#8217;m on several projects with differing and complicated configs \u00a0for Maven, and use a few different Eclipse\/IDE installs to manage all the preferences between the projects. \u00a0With many different leads can be different Check Style files, PMD rules sets, formatting rules, naming conventions etc. \u00a0Why not just the same standards universally? \u00a0Well, different projects [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/839"}],"collection":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=839"}],"version-history":[{"count":13,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/839\/revisions"}],"predecessor-version":[{"id":853,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/839\/revisions\/853"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=839"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}