您好,登錄后才能下訂單哦!
這篇文章主要講解了“maven代理倉庫的使用方法”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“maven代理倉庫的使用方法”吧!
倉庫名稱 | 代理源地址 | 使用地址 |
---|---|---|
central | https://repo1.maven.org/maven2/ | https://maven.aliyun.com/repository/central 或 https://maven.aliyun.com/nexus/content/repositories/central |
jcenter | http://jcenter.bintray.com/ | https://maven.aliyun.com/repository/jcenter 或 https://maven.aliyun.com/nexus/content/repositories/jcenter |
public | central倉和jcenter倉的聚合倉 | https://maven.aliyun.com/repository/public 或https://maven.aliyun.com/nexus/content/groups/public |
https://maven.google.com/ | https://maven.aliyun.com/repository/google 或 https://maven.aliyun.com/nexus/content/repositories/google | |
gradle-plugin | https://plugins.gradle.org/m2/ | https://maven.aliyun.com/repository/gradle-plugin 或 https://maven.aliyun.com/nexus/content/repositories/gradle-plugin |
spring | http://repo.spring.io/libs-milestone/ | https://maven.aliyun.com/repository/spring 或 https://maven.aliyun.com/nexus/content/repositories/spring |
spring-plugin | http://repo.spring.io/plugins-release/ | https://maven.aliyun.com/repository/spring-plugin 或 https://maven.aliyun.com/nexus/content/repositories/spring-plugin |
grails-core | https://repo.grails.org/grails/core | https://maven.aliyun.com/repository/grails-core 或 https://maven.aliyun.com/nexus/content/repositories/grails-core |
apache snapshots | https://repository.apache.org/snapshots/ | https://maven.aliyun.com/repository/apache-snapshots 或 https://maven.aliyun.com/nexus/content/repositories/apache-snapshots |
打開maven的配置文件(windows機器一般在maven安裝目錄的conf/settings.xml),在<mirrors></mirrors>
標簽中添加mirror子節點:
<mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <name>阿里云公共倉庫</name> <url>https://maven.aliyun.com/repository/public</url> </mirror>
如果想使用其它代理倉庫,可在<repositories></repositories>
節點中加入對應的倉庫使用地址。以使用spring代理倉為例:
<repository> <id>spring</id> <url>https://maven.aliyun.com/repository/spring</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository>
在build.gradle文件中加入以下代碼:
allprojects { repositories { maven { url 'https://maven.aliyun.com/repository/public/' } mavenLocal() mavenCentral() } }
如果想使用maven.aliyun.com提供的其它代理倉,以使用spring倉為例,代碼如下:
allProjects { repositories { maven { url 'https://maven.aliyun.com/repository/public/' } maven { url 'https://maven.aliyun.com/repository/spring/'} mavenLocal() mavenCentral() } }
感謝各位的閱讀,以上就是“maven代理倉庫的使用方法”的內容了,經過本文的學習后,相信大家對maven代理倉庫的使用方法這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。