依赖查询
Maven仓库查询
如果使用中央仓库 Eclipse 极有可能会卡死
以下是国内镜像库
a 阿里云 https://maven.aliyun.com/mvn/guide
<repositories> <repository> <id>central</id> <url>https://maven.aliyun.com/repository/central</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>jcenter</id> <url>https://maven.aliyun.com/repository/public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>google</id> <url>https://maven.aliyun.com/repository/google</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>spring</id> <url>https://maven.aliyun.com/repository/spring</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>spring-plugin</id> <url>https://maven.aliyun.com/repository/spring-plugin</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>apache snapshots</id> <url>https://maven.aliyun.com/repository/apache-snapshots</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories>
让自己的项目带着仓库飞
<repositories> <repository> <id>my</id> <url>file://${project.basedir}/src/mylibs</url> </repository> </repositories> <dependencies> <dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>my1.10.2</version> </dependency> </dependencies>
用这个命令把你的私人jar装到项目中的仓库(linux)
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<myGroup> -DartifactId=<myArtifactId> -Dversion=<myVersion> -Dpackaging=<myPackaging> -DlocalRepositoryPath=<path-to-my-repo>
Windows 下把 去掉
注:项目仓库中的jar会被同步到本地仓库中