如何更改 Maven 中的用户代理?我需要能够更改它以通过公司防火墙。我使用的是 2.2.1 版本,我注意到 2.0.10 发行说明中的改进:
[MNG-3652] - 为 Maven HTTP 请求设置用户代理。
如何更改 Maven 中的用户代理?我需要能够更改它以通过公司防火墙。我使用的是 2.2.1 版本,我注意到 2.0.10 发行说明中的改进:
[MNG-3652] - 为 Maven HTTP 请求设置用户代理。
Brett Porter posted a blog on Configuring Maven HTTP Connections that describes how you can do this and some other funky things:
<server>
<id>archiva.localhost</id>
<configuration>
<httpHeaders>
<property>
<name>User-Agent</name>
<value>Internal-Build-System/1.0</value>
</property>
</httpHeaders>
</configuration>
</server>
对于命令行版本尝试
"-Daether.connector.userAgent=your custom user agent"