搜索引擎是网站吗,c 新手一个人做网站,国际展览中心有什么展览,wordpress跳转到不同分站转载自 Maven精选系列--私库搭建及使用为什么要使用私库maven默认去远程中央仓库下载JAR包的#xff0c;访问国外网络相当慢#xff0c;如果团队每个人都去下载一遍无疑是网络的浪费#xff0c;当然也可以添加国内的镜像#xff0c;如阿里的比较稳定#xff0c;但如果想添…转载自 Maven精选系列--私库搭建及使用为什么要使用私库maven默认去远程中央仓库下载JAR包的访问国外网络相当慢如果团队每个人都去下载一遍无疑是网络的浪费当然也可以添加国内的镜像如阿里的比较稳定但如果想添加远程不存在的像第三方公司的JAR包就比较麻烦。所以使用私库第一开源包只要有一个人下载过其他人就不需要再下载了直接从私库下载即可。第二可以用来管理第三方公司的或者远程仓库不存在的JAR包或者公司不开源的JAR包。推荐国内稳定的镜像如阿里的
http://maven.aliyun.com/nexus/content/groups/public/nexus下载安装首先去sonatype官网下载nexus包要下载开源免费版的OSS版即Open Source Software。https://www.sonatype.com/nexus-repository-oss下载最新的3.X的版本这里以windows为例进行下载。下载后点击bin目录中的启动文件即可默认的端口是8081访问路径是/也可以去配置文件中修改这里以默认。启动后打开localhost:8081nexus默认的用户名是admin/admin123默认安装有以下这几个仓库在控制台也可以修改远程仓库的地址第三方仓库等。Maven配置修改maven主目录conf/setting.xml配置文件。添加nexus认证的用户名和密码配置信息。serversserveridnexus-releases/idprivateKeyadmin/privateKeypassphraseadmin123/passphrase/serverserveridnexus-snapshots/idprivateKeyadmin/privateKeypassphraseadmin123/passphrase/server
/servers添加mirror镜像mirrorsmirroridNexus/idmirrorOf*/mirrorOfnameNexus/nameurlhttp://127.0.0.1:8081/repository/maven-public//url/mirror/mirrors添加私库profilesprofileidNexus/idrepositoriesrepositoryidNexus/idnameNexus/nameurlhttp://127.0.0.1:8081/repository/maven-public//urlreleasesenabledtrue/enabled/releasessnapshotsenabledtrue/enabled/snapshots/repository/repositoriespluginRepositoriespluginRepositoryidNexus/idnameNexus/nameurlhttp://127.0.0.1:8081/repository/maven-public//urlreleasesenabledtrue/enabled/releasessnapshotsenabledtrue/enabled/snapshots/pluginRepository/pluginRepositories/profile
/profiles激活私库activeProfilesactiveProfileNexus/activeProfile
/activeProfiles发布到私库在pom配置文件中添加!-- nexus-releases nexus-snapshots与settings.xml中server下的id对应 --
distributionManagementrepositoryidnexus-releases/idnameNexus Releases Repository/nameurlhttp://localhost:8081/nexus/content/repositories/releases//url/repositorysnapshotRepositoryidnexus-snapshots/idnameNexus Snapshots Repository/nameurlhttp://localhost:8081/nexus/content/repositories/snapshots//url/snapshotRepository
/distributionManagement在项目上使用命令mvn deploy打包就能发布到私库。