Failed to execute goal ... maven-install-plugin ... Failed to install artifact ... (Access is denied)

You may have a typo in your -Dfile argument. Make sure it's pointing to an actual file, not a folder.

I.e. Make sure you don't have -Dfile=C:\lib\jackson when you mean -Dfile=C:\lib\jackson.jar


Targeting a folder can cause this "Access Denied" error, which doesn't seem to make sense for what the actual problem is.


This issue started to happen after a NetBeans crash. I finally deleted the content of .m2 and re-installed NetBeans from scratch. The issue disappeared. I am still unclear what would cause it, but it is now gone.


I have experienced this problem in Eclipse Indigo SR2, and I was hoping to try something less drastic than deleting .m2.

I tried to uncheck "Resolve dependencies from Workspace projects" as described in this post, but continued to get the message.

I finally got it working by running mvn clean install from the command line.