展开
拓展 关闭
订阅号推广码
GitHub
视频
公告栏 关闭

idea操作私服

  • 简介
上传资源时,需要知道上传的指定仓库和用户名密码,且上传地址必须配置到项目里
下载资源时,需要知道资源的仓库地址和用户名密码,且下载地址可以配置到本地仓库,因为idea从本地仓库中拿资源

  • 当前在nexus中新建了2个仓库:heima-release、heima-snapshots

  • 打开maven安装目录的settings.xml

<servers>
<server>
<id>heima-release</id>
<username>admin</username>
<password>admin</password>
</server>
<server>
<id>heima-snapshots</id>
<username>admin</username>
<password>admin</password>
</server>
</servers>
<mirrors>
<!--阿里云的镜像-->
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf> <!--表示要从中央仓库拿资源时,会通过阿里云镜像-->
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<!--私服-->
<mirror>
<id>nexus-heima</id>
<mirrorOf>*</mirrorOf> <!--表示任意类型的资源都可以从私服中获取-->
<url>http://localhost:8081/repository/maven-public/</url>
</mirror>
</mirrors>
# 最后将该settings.xml复制到C:\Users\本机名\.m2目录下
  • 上传资源
# 在父工程pom中配置如下
<!--发布配置管理-->
<distributionManagement>
<repository>
<id>heima-release</id>
<url>http://localhost:8081/repository/heima-release/</url>
</repository>
<snapshotRepository>
<id>heima-snapshots</id>
<url>http://localhost:8081/repository/heima-snapshots/</url>
</snapshotRepository>
</distributionManagement>
# 点击右侧deploy
# 或者输入命令mvn deploy
# 即可发布到私服
posted @   DogLeftover  阅读(50)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示