Cargo 无法通过与 Maven 2 集成的代理运行

发布于 2024-08-07 10:35:03 字数 2128 浏览 3 评论 0原文

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

在热部署期间,我无法连接到可通过代理访问的 Tomcat 容器。我的 Maven settings.xml 已经包含代理设置,但货物没有拾取它。

我尝试明确地为 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>

请帮忙。

提前致谢。

阿什什

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</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>

Please help.

Thanks in advance.

Ashish

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

[浮城] 2024-08-14 10:35:03

我可能是错的,但我认为 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>"

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>"
晨与橙与城 2024-08-14 10:35:03

希望这个代理问题将在 Cargo 1.1.0 中得到解决

Hopefully this issue with proxy will be fixed in Cargo 1.1.0

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文