2009-10-09 31 views
3

我在我的Maven 2項目POM.xml中集成了Cargo插件。貨物不能通過與Maven 2集成的代理工作

在熱部署期間,我無法連接到通過代理可用的Tomcat容器。我的maven settings.xml已經包含了代理設置,但是貨物並沒有選擇它。

我試着定義代理設置貨物插件expilicitly但也沒有奏效。

我的貨物插件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> 

請幫助。

在此先感謝。

阿希什

回答

2

我可能是錯的,但我不認爲貨物支持這一點。但是,作爲Tomcat的遠程部署者使用管理器應用程序,因此HTTP,嘗試通過在命令行上的屬性來設置JVM級別的代理服務器設置調用Maven的時候:

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

或者使用環境變量MAVEN_OPTS

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