How can the user-agent be changed in Maven?

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] - set a user agent for Maven HTTP requests.

13.10.2009 17:14:29
2 ОТВЕТА
РЕШЕНИЕ

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>
7
13.10.2009 19:09:49

for command line version try

"-Daether.connector.userAgent=your custom user agent"
0
5.03.2020 08:44:02