Maven库(repository)链接记录分享

Java项目开发过程中会用到大量jar包,Maven项目的pom文件配置也需要一定数量的jar包仓库或者对maven进行配置。

1 Maven库(repository)链接

1.1 Mvnrepository

可以搜索和项目主题相关的库及jar包链接,配置maven,gradle等工具。
仓库链接: https://mvnrepository.com/.
在这里插入图片描述

1.2 Sonatype Nexus Repository Manager

开源地理信息系统GIS仓库,包含geotools等库。
官方主页:https://osgeo.org/
OSGeo
仓库链接: https://repo.osgeo.org/.
在这里插入图片描述

1.3 Scijava

Java 中的科学库,为科学计算提供软件的项目的协作——在可行的情况下努力协作和重用代码。
它也是基础软件库的集合, ImageJ2和Fiji都是在这些库上构建的。1
官方主页:https://scijava.org/
scijava

Github主页:https://github.com/scijava
仓库链接: https://maven.scijava.org/ .

1.4 阿里云Maven

官方主页:https://developer.aliyun.com/mvn/guide
在这里插入图片描述google代码地址
https://maven.aliyun.com/repository/google

2 Maven库(repository)pom.xml文件配置方法

maven 配置方法又以下两种2
打开 maven 的配置文件( windows 机器一般在 maven 安装目录的conf/settings.xml),在<mirrors></mirrors>标签中添加mirror子节点:

<mirror>
  <id>仓库英文名</id>
  <mirrorOf>*</mirrorOf>
  <name>仓库名</name>
  <url>https://maven.aliyun.com/repository/public</url>
</mirror>

如果想使用其它代理仓库,可在<repositories></repositories>节点中加入对应的仓库使用地址。

<repository>
  <id>仓库英文名</id>
  <url>仓库链接</url>
  <releases>
    <enabled>true</enabled>
  </releases>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
</repository>

在你的pom.xml文件<denpendencies></denpendencies>节点中加入你要引用的文件信息:

<dependency>
  <groupId>[GROUP_ID]</groupId>
  <artifactId>[ARTIFACT_ID]</artifactId>
  <version>[VERSION]</version>
</dependency>

之后在java IDE中构建项目即可

3 JavaDoc文档

https://javadoc.scijava.org/
进入主页后点击即可进入下面的图标即可跳转链接的库帮助文件
javadoc.scijava.org

4 示例

4.1 以setting.xml文件为例

可以将下面的内容补充到maven 安装目录的conf/settings.xml中。

<mirrors>
    <!-- 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>
     -->
    <mirror>
    <id>nexus-aliyun</id>
    <mirrorOf>*</mirrorOf>
    <name>Nexus aliyun</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>
    <mirror>
        <id>alimaven</id>
        <name>aliyun maven</name>
        <url>https://maven.aliyun.com/repository/public</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
    <mirror>
        <id>alimaven-central</id>
        <name>aliyun maven central</name>
        <url>https://maven.aliyun.com/repository/central</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
    <mirror>
        <id>alimaven-spring</id>
        <name>aliyun maven-spring</name>
        <url>https://maven.aliyun.com/repository/spring</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
    <mirror>
        <id>central</id>
        <name>Maven Repository Switchboard</name>
        <url>https://repo1.maven.org/maven2/</url>
        <mirrorOf>central</mirrorOf>
    </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>spring-snapshots</id>
        <mirrorOf>central</mirrorOf>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
    </mirror>
    <mirror>
        <id>spring-milestones</id>
        <mirrorOf>central</mirrorOf>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
    </mirror>
     <mirror>
        <id>gephi</id>
        <name>gephi</name>
        <url>https://repo1.maven.org/maven2/org/gephi/</url>
        <mirrorOf>central</mirrorOf>
      </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>netbeans</id>
        <name>NetBeans</name>
        <url>http://netbeans.apidesign.org/maven2/</url>
        <mirrorOf>central</mirrorOf>
      </mirror>

        <mirror>
            <id>imagej.public</id>
             <name>imagej.public</name>
            <url>http://maven.imagej.net/content/groups/public</url>
        </mirror>
  </mirrors>

4.2 以pom.xml文件为例

可以将下面的内容补充到jave maven项目的pom.xml中。

 <repositories>
	<repository>
	    <id>nexus aliyun</id>
	    <name>Nexus aliyun</name>
	    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
	</repository>
	<repository>
	    <id>alimaven</id>
	    <name>aliyun maven</name>
	    <url>https://maven.aliyun.com/repository/public/</url>
	</repository>
	<repository>
	    <id>alimaven-central</id>
	    <name>aliyun maven central</name>
	    <url>https://maven.aliyun.com/repository/central/</url>
	</repository>
	<repository>
	    <id>mvnrepository.com</id>
	    <name>mvnrepository</name>
	    <url>https://mvnrepository.com/</url>
	</repository>	    
	<repository>
	    <id>geo</id>
	    <name>osgeo</name>
	    <url>https://repo.osgeo.org/</url>
	</repository>	    
	<repository>
	    <id>maven2-repository.dev.java.net</id>
	    <name>Java.net repository</name>
	    <url>http://download.java.net/maven/2</url>
	</repository> 
	<repository>
	    <id>clojars</id>
	    <name>clojars Repository</name>
	    <url>https://repo.clojars.org/</url>
	</repository> 
	 <repository>
            <id>osgeo</id>
            <name>Open Source Geospatial Foundation Repository</name>
            <url>https://repo.osgeo.org/service/rest/repository/browse/release/</url>
        </repository> 
        <repository>
            <id>geo-solutions</id>
            <name>Open Source Geospatial Foundation Repository geo-solutions</name>
            <url>http://maven.geo-solutions.it/</url>
        </repository> 
        <repository>
            <id>geotoolkit</id>
            <name>Open Source Geospatial Foundation Repository geotoolkit</name>
            <url>https://nexus.geomatys.com/service/rest/repository/browse/geotoolkit/</url>
        </repository> 
    </repositories>

  1. SciJava:https://imagej.net/libs/scijava#scijava-common ↩︎

  2. maven 配置指南:https://developer.aliyun.com/mvn/guide ↩︎

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值