Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 790
Dan Polites Avatar asked Dec 18 '25 00:12

Dan Polites


1 Answers

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>
like image 91
Rich Seller Avatar answered Dec 20 '25 02:12

Rich Seller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!