Maven, Access denied to: http://repo1.maven.org/maven2

前端 未结 4 1072
忘了有多久
忘了有多久 2020-12-16 20:33

I have just downloaded last version of Maven.

And when i am trying to run

mvn archetype:generate

i get error message

相关标签:
4条回答
  • 2020-12-16 21:10

    it seem to work with maven 2 (reproduced the problem on 3 machines linux and windows with maven 3.05 and maven 3.1)

    the problem occurs only for the repo1... urls. If you delete your local repository, all plugin downloads will work fine until the download of archetype catalog - "access denied"

    0 讨论(0)
  • 2020-12-16 21:11

    It seems as though directory browsing on http://repo1.maven.org/maven2 has been switched off. I had to resort to getting the archetype catalog myself. I did this:

    mvn archetype:generate -DarchetypeCatalog=http://search.maven.org/remotecontent?filepath=archetype-catalog.xml
    

    Alternatively I guess you could just download the archetype-catalog.xml file from that link and place it in your .m2 directory as mentioned in this comment:

    http://jira.codehaus.org/browse/ARCHETYPE-202?focusedCommentId=182771&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-182771

    0 讨论(0)
  • 2020-12-16 21:11

    It seems like Apache central repository has fixed the issue. So without making any change, the problem is fixed now. Please try once again and let us know in case of any issue.

    0 讨论(0)
  • 2020-12-16 21:14

    Execute this Command. It will not only create your maven project but also resolve the issue of downloading archetype jar. It is mainly due to unavailability to the archetype URL.

    Fill Project Group Id with your project names.

    mvn archetype:generate -DgroupId={Project Group Id} -DartifactId={Project Id} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false -DarchetypeCatalog=http://search.maven.org/remotecontent?filepath=archetype-catalog.xml

    0 讨论(0)
提交回复
热议问题