Access denied to: http://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.4/commons-codec-1.4.pom , ReasonPhrase:Forbidden

In case anyone did come across this issue recently (i.e. through a Google search), there might also be a different cause.

Some Maven repositories (i.e. maven.springframework.org) have disabled HTTP access and are now returning a "403 Forbidden" error for all HTTP requests instead of redirecting to HTTPS. In this case, please update your maven build file (pom.xml) to use HTTPS repository URLs instead of the HTTP ones.


The error message is misleading - rather than having denied acess to specific file in the central maven repository, it's more probable that you're being denied writing access to your local maven pom directory. This can happen if you've used several different user accounts, for instance.

Running maven with debug flag, mvn -X clean install, should show you more appropriate error message letting you know about the real cause.

Tags:

Maven