Resolving Maven blacklisted artficats

I am fairly new to Maven (been reading a lot about it but did not use it for anything larger than sample apps), and recently attempted to set up an internal Maven repository (using Artifactory) in my organization. Due to misconfiguration of proxy settings, I was not able to download a plugin from the internal repo (that was not cached there at the time, which Artifactory attempted to download from central), and my internal repository got blacklisted for that particular artifact.

However, even after I fixed Artifactory configuration to use the correct proxy to download from central, I was not able to get the build working because for that particular artifact, Maven has blacklisted my internal repository. Each consecutive Maven run fails even without even checking my internal repo as it is blacklisted.

The way to get around from such a situation is to use the -U flag when invoking Maven run, so that it will force Maven to update all plugins from the repository. For example, if you are trying to run the install life cycle phase,

mvn -U install

Once -U flag was given, Maven successfully attempted to resolve the dependency from my internal repository, which then downloaded and cached it from central, and made it available for my build.

I found the above solution buried under replies for a post in a Maven-User mailing list, after some time spent Googling.

So I just thought of writing about this here in my blog, hoping that Google will pick this up and help a poor soul in search for a solution for the same thing :).

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *