Maven - generate maven settings.xml in an enterprise environment

How to generate maven settings.xml in an enterprise environment?

  1. You can generate the settings.xml file from the artifactory.
  2. If you have the link the artifactory, follow these steps to generate the settings.xml
  3. url for JFrog artifactory -> Set Me Up -> Tool - Maven -> Type password (if the artifactory is protected) and click on “generate the code snippet” and download the file. If the artifactory needs a password, the downloaded file will have a hash of the password.
  4. Drop this file in your .m2 directory and the applications in local computer should be able to connect to the artifactory.
  5. If you can login to JFrog (or your artifactory) and see the repositories and artifacts, but if you see errors when you run maven commands in local workspace, double check the urls in the settings.xml file
    1. Sometimes, the port number may have to be specified in the url
    2. The “set me up” tool does not include port numbers in the settings.xml file that it spits out
    3. You may have to include it yourself.
    4. e.g. <url>https://artifactory.company:443/artifactory/plugins/release%3Curl%3E

Links to this note