Configuring XCP Designer to use a different maven local repository (or .m2 cache)

Hi Folks,

Long time, no speak.  Apologies for being quite so silent for so long.  I hope this blog post finds you all well?   I am starting to build up a bank of XCP Designer tips and tricks so I’ll start blogging them here.

One of the questions that I often get about XCP Designer is:-

“Is it possible to have a separate .m2 cache for different instances of XCP Designer”.

(Which is usually different versions of designers).  And the answer is yes.

Under the covers of XCP Designer’s user interface is a completely standard instance of Eclipse and, important to this conversation, m2e.  And in fact the projects that XCP Designer creates are also completely standard maven projects (we instantiate maven archetypes actually).  What this all means is that anything you can do in eclipse and m2e or a maven project, you can pretty much do in XCP Designer.  The problem is that we hide all of the standard eclipse and m2e user interface and project structure, so it is often difficult to know how!

For the case we are dealing with here, configuring a separate .m2 cache for different instances of designer, m2e actually supports a workspace preference for pointing your eclipse workspace at a settings.xml file (details of configuring maven’s settings.xml can be found here).  Now m2e surfaces this in their preferences page but of course XCP Designer hides this! So we will configure it’s value via a property file instead and then use this preference to point m2e at a settings.xml file of our choosing in which we will configure the location of the local repository that we wish to use.  Here are the steps:-

  1. Customize your designer installation(s) by  using 7zip (or some equivalent) and adding the following entry to the plugin_customization.ini file in the <designer-basedir>/plugins/com.emc.xcp.builder.ui-<version>.jar

    org.eclipse.m2e.core/eclipse.m2.globalSettingsFile=c:/temp/my-settings.xml

  2. Then, in c:/temp/my-settings.xml, add the following configuration:-
    <settings>
      <localRepository>/path/to/local/repo/</localRepository>
    </settings>

That’s it.  Pretty simple when you know how huh?  In case it isn’t obvious if you just want XCP Designer to use a different local repository (as opposed to configuring different instances of XCP Designer) then step #1 is optional.

Have fun!

_Paul