Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide HTTP password when downloading maven artifacts

Tags:

maven

buildr

We have a password protected Maven repository. When downloading the http password is shown on the console:

Downloading: https://arved:[email protected]/content/groups/arved/org/apache/xbean/xbean-naming/3.7/xbean-naming-3.7.jar

Is it possible to hide the password somehow?

like image 508
arved Avatar asked Oct 22 '22 20:10

arved


1 Answers

Your repository configuration (URL) is probably wrong, look at this page: http://maven.apache.org/guides/mini/guide-encryption.html (encryption is optional)

All what you need is to put password to $HOME/.m2/settings.xml

<settings>
...
  <servers>
...
    <server>
      <id>arved-repository</id>
      <username>arved</username>
      <password>passw0rd</password>
    </server>
...
  </servers>
...
</settings>

And configure repository in pom.xml using defined earlier server.id:

<project>
...
  <repositories>
    <repository>
      <id>arved-repository</id>
      <name>Arved Repository</name>
      <url>https://maven.arved.at/content/groups/arved</url>
    </repository>
...
</project>
like image 62
MariuszS Avatar answered Oct 31 '22 16:10

MariuszS