Skip navigation
    5 Replies Latest reply on Jul 1, 2014 6:49 PM by supergalaxy5

    Fabric agent doesn't use http proxy settings for maven connections

    banderus

      Hello,

       

       

      I'm trying to configure fabric-agent to use http proxy for its maven connections.

       

      I changed config properties in ${fuse.install.dir}/etc/org.ops4j.pax.url.mvn.cfg as:

      org.ops4j.pax.url.mvn.proxySupport=true

       

      I put all my proxy details into ${user.home}/.m2/settings.xml

       

      But fabric agent still can't get any artifact located outside of its system repository (${fuse.install.dir}/system):

      2013-12-27 14:25:38,760 | DEBUG | e-084-thread-107 | AbstractDownloadTask        | 98 - org.fusesource.fabric.fabric-agent - 7.0.1.fuse-084 |   Could no

      t download [Version [7.0.1.fuse-084] from URL [http://repo1.maven.org/maven2/org/fusesource/fabric/fabric-zookeeper-commands/7.0.1.fuse-084/fabric-zookeeper-

      commands-7.0.1.fuse-084.jar]]

       

      I tried these versions of fabric with the same result:

      7.0.1.fuse-084

      7.2.0.redhat-024

      7.3.0.redhat-139

       

       

      I did a quick research and it seems that the problem is in this file:

      fuse/fabric/fabric-agent/src/main/java/io/fabric8/agent/mvn/MavenSettingsImpl.java at master · jboss-fuse/fuse · GitHub

       

      Basically io.fabric8.agent.mvn.MavenSettingsImpl#getProxySettings() returns empty map:

      public Map<String, Map<String, String>> getProxySettings() {

              if (m_proxySettings == null) {

                  m_proxySettings = new HashMap<String, Map<String, String>>();



      And then org.fusesource.fabric.agent.mvn.MavenConfigurationImpl#enableProxy() does nothing when trying to set proxy settings for target http connections:

      Map proxyDetails = (Map)this.m_settings.getProxySettings().get(protocol);

      if (proxyDetails != null) {

       

       

      Also it looks like that MavenSettingsImpl#getProxySettings contains code that should do this job. But it is commented out..

       

       

       

      Could you please confirm that is a bug or I'm doing smth completely wrong?