搜尋

首頁  >  問答  >  主體

java - maven无法下载依赖怎么办

pom.xml 右键 maven install 后,直接就BUILD SUCCESS了,一个依赖都没有下载,可能是maven主库被墙的缘故,然后在maven/conf/setting.xml里配置镜像如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

<code><mirrors>

     <mirror> 

      <id>CN</id> 

      <name>OSChina Central</name>                                                                                                                        

      <url>http://maven.oschina.net/content/groups/public/</url> 

      <mirrorOf>central</mirrorOf>

    </mirror> 

</mirrors>

<profiles>

    <profile>

      <id>jdk-1.8</id>

      <activation>

      <jdk>1.8</jdk>

      </activation>

      <repositories>

        <repository>

          <id>nexus</id>

          <name>local private nexus</name>

          <url>http://maven.oschina.net/content/groups/public/</url>

          <releases>

            <enabled>true</enabled>

          </releases>

          <snapshots>

            <enabled>false</enabled>

          </snapshots>

        </repository>

      </repositories>

      <pluginRepositories>

        <pluginRepository>

          <id>nexus</id>

          <name>local private nexus</name>

          <url>http://maven.oschina.net/content/groups/public/</url>

          <releases>

            <enabled>true</enabled>

          </releases>

          <snapshots>

            <enabled>false</enabled>

          </snapshots>

        </pluginRepository>

      </pluginRepositories>

</profile></code>

结果还是无法下载依赖,这究竟怎么回事?

PHPzPHPz2896 天前422

全部回覆(1)我來回復

  • 阿神

    阿神2017-04-17 17:55:50

    oschina鏡像不是已經關閉了嗎?你去搜一下?
    http://maven.oschina.net/

    下面是一些常用的maven庫

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    <code>http://repo1.maven.org/maven2/

    http://repository.jboss.com/maven2/

    http://repository.sonatype.org/content/groups/public/ 

    http://mirrors.ibiblio.org/pub/mirrors/maven2/org/acegisecurity/

     

    http://maven.glassfish.org/content/groups/glassfish/

     

    https://nexus.sourcesense.com/nexus/content/repositories/public/

    http://repository.codehaus.org/

    </code>

    回覆
    0
  • 取消回覆