Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

maven

I trying to build the maven project,

whenever I run the "mvn clean install" on the command line, I get the following error:

Could not resolve dependencies for project com.my_project:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [com.datastax.cassandra:cassandra-driver-core:jar:3.0.1 (compile), org.apache.kafka:kafka-clients:jar:0.9.0.1 (compile), org.apache.kafka:kafka_2.10:jar:0.9.0.1 (compile), com.thinkaurelius.titan:titan-core:jar:1.0.0 (compile), com.tinkerpop.blueprints:blueprints-core:jar:2.6.0 (compile), com.thinkaurelius.titan:titan-cassandra:jar:1.0.0 (compile), com.thinkaurelius.titan:titan-all:jar:1.0.0 (compile), org.aspectj:aspectjrt:jar:1.6.5 (compile), com.jayway.awaitility:awaitility:jar:1.6.5 (compile), junit:junit:jar:4.11 (test)]: Failed to read artifact descriptor for commons-codec:commons-codec:jar:1.4: Could not transfer artifact commons-codec:commons-codec:pom:1.4 from/to central (http://repo.maven.apache.org/maven2): Access denied to: http://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.4/commons-codec-1.4.pom , ReasonPhrase:Forbidden. -> [Help 1]

Please, help me I am new to JAVA world.

Is it some kind of proxy setting that I denied access?

like image 289
Invictus Avatar asked Mar 14 '17 19:03

Invictus


2 Answers

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.

like image 184
big data nerd Avatar answered Nov 15 '22 14:11

big data nerd


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.

like image 20
eis Avatar answered Nov 15 '22 14:11

eis