gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 07:43:46 29 4
gpt4 key购买 nike

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

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

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

请帮忙。

提前致谢。

阿什什

最佳答案

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

关于maven-2 - Cargo 无法通过与 Maven 2 集成的代理运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1543203/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com