如何更改Maven中的用户代理?我需要能够更改此设置以通过公司防火墙。我正在使用2.2.1版,并且注意到2.0.10发行说明中有一个改进:
[[MNG-3652]-为Maven HTTP请求设置用户代理。
[Brett Porter在Configuring Maven HTTP Connections上发布了一个博客,描述了如何执行此操作以及其他一些时髦的事情:
<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"