nexus3添加jar包

一、使用最高权限登录nexus

输入默认账号:admin 密码:admin123

这里写图片描述

二、创建第三方私有maven仓库

选择导航栏的齿轮,点击左侧菜单 Repositories,点击Create repository

这里写图片描述

选择 maven2 hosted

这里写图片描述

Name 输入 3rdParty ,Hosted选择Allow redeploy,点击 Create repository

这里写图片描述

查看到 3rdParty ,创建成功!~

这里写图片描述

三、修改maven 插件

修改/conf/settings.xml文件

这里写图片描述

找到servers标签 增加

    <server><!-- nexus3 -->
        <id>3rdParty</id>
        <username>admin</username>
        <password>admin123</password>
    </server>

这里写图片描述

四、jar包上传nexus

打开cmd控制台,输入如下:

mvn deploy:deploy-file -DgroupId=com.baidu.ueditor -DartifactId=ueditor -Dversion=1.1.2 -Dpackaging=jar -Dfile=D:\ueditor-1.1.2.jar -Durl=http://localhost:8081/repository/3rdParty/ -DrepositoryId=3rdParty

这里写图片描述

这里写图片描述

成功!~

这里写图片描述

对控制台输入内容的解析

        <dependency>
            <groupId>com.baidu.ueditor</groupId>
            <artifactId>ueditor</artifactId>
            <version>1.1.2</version>
        </dependency>
mvn deploy:deploy-file -DgroupId=com.baidu.ueditor -DartifactId=ueditor -Dversion=1.1.2 -Dpackaging=jar -Dfile=D:\ueditor-1.1.2.jar -Durl=http://localhost:8081/repository/3rdParty/ -DrepositoryId=3rdParty

DgroupId: 对应pom.xml中 <groupId>
DartifactId: 对应pom.xml中 <artifactId>
Dversion: 对应pom.xml中 <version>
Dpackaging: 包的类型
Dfile: 包所在路径
Durl: nexus的3rdParty路径(可以在nexus中找到3rdParty私有仓库,在url列点击copy按钮)
DrepositoryId: 选择仓库

猜你喜欢

转载自blog.csdn.net/u010318957/article/details/72573603
今日推荐