货物无法通过与maven 2集成的代理工作

时间:2009-10-09 11:17:34

标签: maven-2 cargo

我在我的maven 2项目POM.xml中集成了Cargo插件。

在热部署期间,我无法连接到代理中可用的Tomcat容器。我的maven settings.xml已经包含代理设置,但货物没有拿起它。

我尝试为expgoitly定义Cargo插件的代理设置,但这也没有用。

我的Cargo插件xml如下:

<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</cargo.tomcat.manager.url>
        <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>

请帮忙。

提前致谢。

与Ashish

2 个答案:

答案 0 :(得分:2)

我可能错了,但我不认为Cargo支持这个。但是,由于Tomcat的远程部署者使用管理器应用程序,因此使用HTTP,尝试通过在调用maven时在命令行上传递属性来在JVM级别设置代理设置:

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

或使用环境变量MAVEN_OPTS

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

答案 1 :(得分:0)

希望this issue with proxy将在Cargo 1.1.0中修复