Wednesday, April 09, 2014

Show In Tree: Using Artifactory to update Maven pom.xml file

I use Artifactory on a monthly basis, not as often as my daily use of Maven. I did learn something today about using Artifactory that will make my life easier when I need to add further dependencies to a POM file.

As might be known by most Maven users your repository lives under the .m2 directory. Additionally, you may have libraries in your local repository that other users don't currently have.

I made the mistake of presuming that a library was in everyone else's .m2 branch when I added some new code that relied on some less common libraries.

The build failed.

Luckily, the library was in Artifactory.

A very convenient shortcut to update my POM was to find the library in Artifactory, hover over the library, select from the pop-up "Show In Tree," copy the string and paste in the POM file.

Here's a screenshot of what I'm talking about.