如何在Maven中更改用户代理? [英] How can the user-agent be changed in Maven?

查看:82
本文介绍了如何在Maven中更改用户代理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Maven中更改用户代理?我需要能够更改此设置以通过公司防火墙.我正在使用2.2.1版,并且注意到2.0.10发行说明中有一个改进:

How can I change the user-agent in Maven? I need to be able to change this to get through the company firewall. I am using version 2.2.1 and I noticed an improvement in the 2.0.10 release notes:

[MNG-3652]-为Maven HTTP请求设置用户代理.

[MNG-3652] - set a user agent for Maven HTTP requests.

推荐答案

Brett Porter在

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>

这篇关于如何在Maven中更改用户代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆