手动添加jar包到本地maven仓库,上传本地jar包到远程私有仓库

1.手动添加jar包到本地maven仓库

去到jar包存在的目录,不要手动创建目录和把jar包复制过去

mvn install:install-file -Dfile=datax-core-0.0.1-SNAPSHOT.jar -DgroupId=com.alibaba.datax -DartifactId=datax-core -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar

 

2.上传本地jar包到远程私有仓库

2.1.jar包不能在本地仓库的路径下,需要把jar包弄到新的路径下

2.2.maven的setting.xml文件添加私库的用户名和密码

    <server>
        <username>pero_wdd</username>
        <password>pero@1234</password>
        <id>pero-no1</id>
    </server>

2.3.执行命令

mvn deploy:deploy-file -DgroupId=com.alibaba -DartifactId=fastjson -Dversion=2.0.24 -Dpackaging=jar -Dfile=fastjson-2.0.24.jar -DrepositoryId=pero-no1 -Durl=https://xxx.xxx.xxx:8001/pero/my-maven-dev

 

posted @ 2022-08-02 09:40  wdgde  阅读(142)  评论(0)    收藏  举报