IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 开发工具 -> idea项目配置nexus -> 正文阅读

[开发工具]idea项目配置nexus

两个位置
项目第三方jar包位置: http://x.x.x.x:9903/nexus/content/repositories/thirdparty/
项目deploy SNAPSHOT位置: http://x.x.x.x:9903/nexus/content/repositories/demoProject/

nexus使用配置
1, pom 文件配置(每一个项目)

    <!--发布maven私服-->
    <distributionManagement>
        <repository>
            <id>nexus-releases</id>
            <name>nexus-releases</name>
            <url>http://x.x.x.x:9903/nexus/content/repositories/thirdparty/</url>
        </repository>
        <snapshotRepository>
            <id>nexus-snapshots</id>
            <name>nexus-snapshots</name>
            <url>http://x.x.x.x:9903/nexus/content/repositories/demoProject/</url>
        </snapshotRepository>
    </distributionManagement>

2,maven setting 文件配置

2.1 server 配置

 <servers>
	<server>
         <id>nexus-releases</id>
         <username>admin</username>
         <password>admin123</password>
    </server>
  <server>
         <id>nexus-snapshots</id>
         <username>admin</username>
         <password>admin123</password>
    </server>
  </servers>

2.2 mirror配置

   <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://x.x.x.x:9903/nexus/content/repositories/thirdparty/</url>
    </mirror>

2.3 profile配置

 <profile>
      <id>nexus</id>
      <repositories>
        <repository>
          <id>nexus-releases</id>
          <url>http://x.x.x.x:9903/nexus/content/repositories/thirdparty/</url>
     
        </repository>
        <repository>
          <id>nexus-snapshots</id>
          <url>http://x.x.x.x:9903/nexus/content/repositories/demoProject/</url>
          
        </repository>
      </repositories>
      <pluginRepositories>
         <pluginRepository>
                <id>nexus-releases</id>
                 <url>http://x.x.x.x:9903/nexus/content/repositories/thirdparty/</url>
               
               </pluginRepository>
               <pluginRepository>
                 <id>nexus-snapshots</id>
                  <url>http://x.x.x.x:9903/nexus/content/repositories/demoProject/</url>
               
             </pluginRepository>
         </pluginRepositories>
    </profile>

2.4 激活profile配置(位置放在 上面就可以了)


 <activeProfiles>
    <activeProfile>nexus</activeProfile>
  </activeProfiles>

3 注意事项
1,如果项目是多模块的话,每一个模块一定都要pom配置
2, 如何将组件标记为SNAPSHOT:
在POM文件里,有节点,这个节点如果以SNAPSHOT结尾(注意这里必须是全大写),那么就会识别成SNAPSHOT版,否则就是release版。这里需要注意的是《Maven权威指南》的英文版里说的If a version contains the string “-SNAPSHOT,”是错误的,因为当SNAPSHOT在中间,而不是结尾的时候,比如"1.0-SNAPSHOT-a"仍然会被认为是release版,并且连接符也不需要,比如”1.0SNAPSHOT“也是SNAPSHOT版。
3,如果遇到这个问题

Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project cc-common-api: Failed to deploy artifacts: Could not transfer artifact com.ailpha.cc.cc-common-api:jar:1.0-20210721.070933-1 from/to nexus-snapshots (http://x.x.x.x:9903/nexus/content/repositories/demoProject/): Transfer failed for http://x.x.x.x:9903/nexus/content/repositories/demoProject/com/ailpha/cc/cc-common-api/1.0-SNAPSHOT/cc-common-api-1.0-20210721.070933-1.jar 400 Bad Request

  1. 如果部署SNAPSHOT的时候,发生400错误,是因为仓库的Type必须是hosted,且Policy必须是Snapshot,否则就是出现400错误。(你配置的SNAPSHOT存放位置)
    在这里插入图片描述
  开发工具 最新文章
Postman接口测试之Mock快速入门
ASCII码空格替换查表_最全ASCII码对照表0-2
如何使用 ssh 建立 socks 代理
Typora配合PicGo阿里云图床配置
SoapUI、Jmeter、Postman三种接口测试工具的
github用相对路径显示图片_GitHub 中 readm
Windows编译g2o及其g2o viewer
解决jupyter notebook无法连接/ jupyter连接
Git恢复到之前版本
VScode常用快捷键
上一篇文章      下一篇文章      查看所有文章
加:2021-07-22 14:24:15  更:2021-07-22 14:25:28 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/5 10:20:02-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码