如何解决Maven速度慢
注:oschina已失效
Maven 远程仓库
<mirror>
<id>ui</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://uk.maven.org/maven2/</url>
</mirror>
<mirror>
<id>ibiblio</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</mirror>
<mirror>
<id>CN</id>
<name>OSChina Central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
说明:
- 上面的地址前面三个只适合maven,sbt的ivy不适合,sbt需要的jar包在里面会找不到,从下面的配置可以看出。
- oschina的镜像虽然都适用,但是访问速度真是慢
- 最全面的仓库在校园网完全没办法访问
SBT
修改SBT的远程仓库地址有很多办法,这里采用直接修改sbt-lauch.jar/sbt/sbt.boot.properties的方式
[scala]
version: ${sbt.scala.version-auto}
[app]
org: ${sbt.organization-org.scala-sbt}
name: sbt
version: ${sbt.version-read(sbt.version)[0.13.9]}
class: ${sbt.main.class-sbt.xMain}
components: xsbti,extra
cross-versioned: ${sbt.cross.versioned-false}
resources: ${sbt.extraClasspath-}
[repositories]
local
Local-Maven-Repository: file:///D:/Java/java-repositories, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]
ibiblio-maven:http://maven.ibiblio.org/maven2/
typesafe-ivy:https://dl.bintray.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
maven-central
uk-repository: http://uk.maven.org/maven2/
jboss-repository: http://repository.jboss.org/nexus/content/groups/public/
[boot]
directory: ${sbt.boot.directory-${sbt.global.base-${user.home}/.sbt}/boot/}
[ivy]
ivy-home: D:/Java/java-repositories
checksums: ${sbt.checksums-sha1,md5}
override-build-repos: ${sbt.override.build.repos-false}
repository-config: ${sbt.repository.config-${sbt.global.base-${user.home}/.sbt}/repositories}
说明:
- repositories 修改远程仓库地址
- typesafe-ivy:目的是兼容ivy地址
- ivy-home:指的是本地仓库地址,就是jar存在哪里
___________________________________________
在{maven home/conf/settings.xml}中,在<mirror>节点中添加一下镜像
<mirror>
<id>alimaven</id>
<mirrorOf>central<mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
——————————————————————————————
修改
~/.m2/settings.xml
没有此文件需要自行创建个
<settings xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository/>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<pluginGroups/>
<servers/>
<mirrors>
<mirror>
<id>CN</id>
<name>OSChina Central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<proxies/>
<profiles/>
<activeProfiles/>
</settings>
主要是添加mirros
<mirrors>
<mirror>
<id>CN</id>
<name>OSChina Central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
同时在线查找包 http://maven.oschina.net/ 类似maven官网
——————————————————————
/mavenhome/conf/settings.xml <mirrors> <mirror> <id>alimaven</id> <mirrorOf>central<mirrorOf> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/repositories/central/</url> </mirror> <mirror>
<id>ui</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://uk.maven.org/maven2/</url>
</mirror>
<mirror>
<id>ibiblio</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</mirror>
<mirror>
<id>CN</id>
<name>OSChina Central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror> <mirror>
<id>nexus-osc</id>
<mirrorOf>*</mirrorOf>
<name>Nexus osc</name>
<url>http://maven.oschina.net/content/groups/public/</url> </mirror> <!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
</mirrors>
~/.m2/settings.xml <mirrors>
<mirror>
<id>nexus-osc</id>
<mirrorOf>central</mirrorOf><!--这里指定只屏蔽central仓库-->
<name>Nexus osc</name>
<url>http://maven.oschina.net/content/groups/public/</url>
</mirror>
<mirror>
<id>nexus-osc-thirdparty</id>
<mirrorOf>thirdparty</mirrorOf>
<name>Nexus osc thirdparty</name>
<url>http://maven.oschina.net/content/repositories/thirdparty/</url>
</mirror> <mirror>
<id>ui</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://uk.maven.org/maven2/</url>
</mirror>
<mirror>
<id>ibiblio</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</mirror>
<mirror>
<id>CN</id>
<name>OSChina Central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror> </mirrors>
如何解决Maven速度慢的更多相关文章
- Ubuntu 14.04 下解决maven访问速度慢问题
参考: maven国内镜像(maven下载慢的解决方法) maven中央仓库访问速度太慢的解决办法 Ubuntu 14.04 下解决maven访问速度慢问题 在启动OVX的时候,由于sh脚本中需要使用 ...
- 解决maven 在intellij IDEA 下载依赖包速度慢的问题
解决maven 在intellij IDEA 下载依赖包速度慢的问题 参考:https://www.jianshu.com/p/63a593700ebc
- 如何解决Maven和SBT下载Jar包太慢
国内:如何解决Maven和SBT下载Jar包太慢 Maven 远程仓库 <mirror> <id>ui</id> <mirrorOf>central&l ...
- 解决Maven并行编译中出现打包错误问题的思路
解决Maven并行编译中出现打包错误问题的思路 并行构建 Maven 3.x 提供了并行编译的能力,通过执行下列命令就可以利用构建服务器的多线程/多核性能提升构建速度: mvn -T 4 clean ...
- 解决Maven关于本地jar包的打包处理
在使用maven进行jar包管理时,通过我们都是通过maven去下载一些jar包,但有些jar在maven上没有,所以就就可能在本地直接手动加入一些需要用到的外部jar包.但如果我们用maven pa ...
- 解决Maven默认仓库没有的jar下载(二)
前言: 在 “解决Maven不能下载“oracle.aspectjweaver.com.springsource.net.sf.cglib”jar(http://www.cnblogs.com/wql ...
- 解决Maven不能下载“oracle、aspectjweaver、com.springsource.net.sf.cglib”jar
鸣谢网址:http://www.cnblogs.com/dongyangbolg/p/3455422.html http://www.cnblogs.com/ysq0908/p/4737977.htm ...
- 解决maven仓库有jar包但是maven程序无法下载仓库jar包
话说,这个问题困扰了我两个多月了已经~~~ 后来发现不知道被谁动了,把我的仓库没有放到仓库组里面~~~ 用admin登录进去,默认密码是admin123,然后看截图操作吧. (记得删除你本地报错说** ...
- [转]解决Maven报错"Plugin execution not covered by lifecycle configuration"
[转]解决Maven报错"Plugin execution not covered by lifecycle configuration" 导入Myabtis源码后,POM文件会报 ...
随机推荐
- MVC文件上传
这次来看下一个MVC网站上传文件的功能,其中上传用到uploadify这个jquery插件,网上还有很多类似的,哪种都无所谓,能实现功能便行,貌似uploadify官网上的这个插件是要付费的,这里就顺 ...
- Educational Codeforces Round 45 (Rated for Div. 2) E - Post Lamps
E - Post Lamps 思路:一开始看错题,以为一个地方不能重复覆盖,我一想值这不是sb题吗,直接每个power check一下就好....复杂度nlogn 然后发现不是,这样的话,对于每个po ...
- RabbitMQ错误检查
今天使用RabbitMQ做数据下发操作,当在发送端声明了Exchange后 打开RabbitMQ的管理控制台,可以查看,其中已经创建了Exchange 但并没有Queue 接着运行接收端,发现以下错误 ...
- 机器学习之路: tensorflow 一个最简单的神经网络
git: https://github.com/linyi0604/MachineLearning/tree/master/07_tensorflow/ import tensorflow as tf ...
- django设置数据库事务,通过异常处理回滚事务
1.setting.py配置文件,开启事务ATOMIC_REQUESTS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql' ...
- Django MiddleWare初识
一.Django 中间件介绍 中间件是一个用来处理Django的请求和响应的框架级别的钩子.它是一个轻量.低级别的插件系统,用于在全局范围内改变Django的输入和输出.每个中间件组件都负责做一些特定 ...
- [BZOJ4850][JSOI2016]灯塔(分块/决策单调性优化DP)
第一种方法是决策单调性优化DP. 决策单调性是指,设i>j,若在某个位置x(x>i)上,决策i比决策j优,那么在x以后的位置上i都一定比j优. 根号函数是一个典型的具有决策单调性的函数,由 ...
- 关于zip伪加密
创建一个zip文件 然后用winhex打开 可以看到第二个PK头的地方对应hex区域有一场串0000000000 在这里的第四个0这里末尾修改成奇数 奇数为加密 偶数为不加密 再去打开就可以看到加密了
- Subsets LeetCode总结
Subsets 题目 Given a set of distinct integers, nums, return all possible subsets. Note: The solution s ...
- python IDLE 自动提示功能
\Python27\Lib\idlelib\目录下 config-extensions.def文件修改等待时间 [AutoComplete] enable=1 popupwait=2000(2000表 ...