tags:

views:

335

answers:

1

Hello,

I have integrated Cargo plugin in my maven 2 project POM.xml.

During hot deployment I am unable to connect to my Tomcat container that is available across a proxy. My maven settings.xml already contain proxy setting but cargo is not picking it up.

I tried defining proxy settings for Cargo plugin expilicitly but that too didn't worked.

My plugin xml for Cargo is as:

<plugin>
     <groupId>org.codehaus.cargo</groupId>
     <artifactId>cargo-maven2-plugin</artifactId>
     <!--<version>1.0.1-alpha-1</version>-->
     <version>1.0-beta-1</version>
     <configuration>
      <container>
       <containerId>tomcat6x</containerId>
       <type>remote</type>
      </container>
      <configuration>
       <type>runtime</type>
       <properties>
        <cargo.proxy.host>xxx.xxx.xxx.xxx</cargo.proxy.host>
        <cargo.proxy.port>xxxx</cargo.proxy.port>
        <cargo.hostname>xxx.xxx.xxx.xxx</cargo.hostname>
        <cargo.protocol>http</cargo.protocol>
        <cargo.servlet.port>80</cargo.servlet.port>
        <cargo.tomcat.manager.url>http://xxx.xxx.xxx.xxx/manager&lt;/cargo.tomcat.manager.url&gt;
        <cargo.remote.username>xxxxxxx</cargo.remote.username>
        <cargo.remote.password>xxxxxxx</cargo.remote.password>
       </properties>
      </configuration>
      <deployer>
       <type>remote</type>
       <deployables>
        <deployable>
         <groupId>Test</groupId>
         <artifactId>Test</artifactId>
         <type>war</type>
         <!--
          <properties> <context>optional root context</context>
          </properties> <pingURL>optional url to ping to know if deployable
          is done or not</pingURL> <pingTimeout>optional timeout to ping
          (default 20000 milliseconds)</pingTimeout>
         -->
        </deployable>
       </deployables>
      </deployer>
     </configuration>
    </plugin>

Please help.

Thanks in advance.

Ashish

+2  A: 

I may be wrong but I don't think Cargo support this. But, as the remote deployer for Tomcat uses the manager application and thus HTTP, try to set proxy settings at the JVM level by passing properties on the command line when invoking maven:

mvn cargo:deploy -Dhttp.proxyHost=<hostname> -Dhttp.proxyPort=<port>

Or use the environment variable MAVEN_OPTS:

export MAVEN_OPTS="-Dhttp.proxyHost=<hostname> -Dhttp.proxyPort=<port>"
Pascal Thivent