6

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?

3
  • 1
    try running with mvn -X clean install to see debug logs about the actual error Commented Mar 14, 2017 at 19:45
  • removed tags as eclipse nor java are related.. Commented Mar 14, 2017 at 19:46
  • Thanks a lot, the problem was that, I installed the dependencies as ROOT and ran the build cmd through the USER. Commented Mar 15, 2017 at 0:18

2 Answers 2

5

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, that was exactly the issue in my case, even though the bintray.com says "point your Maven at: jcenter.bintray.com", which is to say, with "http" rather than "https". However, when I followed your advice, things worked.
3

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.