Configuring Fuse IDE to Use Maven Proxies

Overview

If you access Maven repositories using proxies, you'll need to ensure that Fuse IDE is configured to use the correct proxies. Fuse IDE can use the same Maven configuration as your command-line installation, or it can use an alternate Maven configuration.

By default, Fuse IDE's Maven integration looks for its configuration in userHome/.m2/settings.xml. For example on Windows XP the default location would be c:\Documents and Settings\jdoe\.m2\settings.xml. On OS X the default location would be /Users/jdoe/.m2/settings.xml.

Procedure

To configure Fuse IDE to use a Maven proxy:

  1. Add the proxy settings to your Maven configuration file.

  2. Configure Fuse IDE's Maven tooling to use the configuration file containing the proxy settings.

Adding the proxy configuration

Maven stores user configuration information in an XML file. By default, Maven and the Fuse IDE Maven tooling look for the file in the user's .m2/settings.xml file. The Fuse IDE Maven tooling can be configured to use a different Maven configuration file if needed.

Because this is a user-specific configuration file, it is not created when Maven or the Fuse IDE Maven tooling is installed. If it does not exist, you need to create it. Example 1 shows the minimum required entries for a Maven configuration file.

Example 1. Minimum Maven configuration file

<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
  ...
</settings>

To configure Maven to use a proxy, you add a proxies element to the settings file. The proxies element is a container for one or more proxy elements that configure individual proxy instances.

The proxy element uses the children described in Table 23 to provide the information for a proxy.

Table 23. Maven proxy configuration elements

ElementDescription
activeSpecifies if the proxy is active.
protocolSpecifies the protocol used by the proxy.
hostSpecifies the proxy's host address.
portSpecifies the port on which the proxy listens.
usernameSpecifies the username, if required, to access the proxy.
passwordSpecifies the password, if required, to access the proxy.
nonProxyHostsSpecifies a | separated list of hosts for which the proxy can be bypassed. The addresses can include wild cards.

Example 2 shows a sample proxy configuration.

Example 2. Maven configuration for a proxy

<settings ... >
  ...
  <proxies>
    <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.sample.fusesource.com</host>
      <port>8080</port>
      <username>proxyuser</username>
      <password>somepassword</password>
      <nonProxyHosts>www.google.com|*.fusesource.com</nonProxyHosts>
    </proxy>
    ...
  </proxies>
  ...
</settings>

Complete documentation for the Maven configuration file can be found at http://maven.apache.org/guides/mini/guide-configuring-maven.html.

Configuring Fuse IDE's Maven tooling

To specify the Maven configuration file and reload your user configuration:

  1. Select Fuse IDE > Preferences to open the Preferences editor.

  2. From the editor's directory tree, select Maven > User Settings.

  3. In User Settings:, enter the full path to your Maven configuration file.

    [Tip]Tip

    The Browse button opens a file browser to help you locate the file.

  4. Click Update Settings to load the new configuration from the configuration file.

  5. In Local Repository (From merged user and global settings):, enter the full path to your local Maven repository ...???

    Need a description of what this Local Repository is and how it's formed, and what reindexing does.

  6. Click Reindex to ...???.

  7. Click OK to apply the changes and close the Preferences editor.