Secured repositories

Maven repositories can be protected for legitimate access. If a given repository is protected with HTTP Basic authentication, the corresponding credentials should be defined, as shown in the following configuration, under the server element of MAVEN_HOME/conf/settings.xml. The value of the id element should match the value of the repository id element:

<server>
  <id>central</id>
  <username>my_username</username>
  <password>my_password</password>
</server>

Note

If a given repository uses HTTP Basic authentication-based security, make sure that you talk to the server over Transport Layer Security (TLS). Plain HTTP will carry your credentials in cleartext. Read more about TLS from http://en.wikipedia.org/wiki/Transport_Layer_Security ...

Get Mastering Apache Maven 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.