【工具使用】maven工程pom.xml中配置未生效

    <repositories>
        <repository>
            <id>spring-releases</id>
            <url>https://repo.spring.io/libs-release</url>
        </repository>
    </repositories>

以上是maven工程中配置的倉庫,編譯時發現並沒有生效,發現是setting.xml中配置的倉庫鏡像問題所導致的:

  <mirrors>
     <mirror>
            <id>alimaven</id>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
        
      <mirror>
      <id>central</id>  
      <name>Central Repository</name>  
      <url>http://repo.maven.apache.org/maven2</url>  
      <mirrorOf>*</mirrorOf>
        </mirror>
  </mirrors>

發現第二個<mirror>中的<mirrorOf>標籤中寫了*號,將*改爲central即可,重新加載發現很多依賴包都自動下載了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章