nexus 3.x maven仓库jar 命令行上传

nexus 3.x maven仓库jar 命令行上传

  1. 进入本地maven 安装目录,如C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.5\plugins\maven\lib\maven3\bin;
  2. 在该目录下放入pom.xml 文件,文件内容可以如下:

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0modelVersion>

    <groupId>com.yszdgroupId>
    <artifactId>yszd-testartifactId>
    <version>2018.06.25version>
    <packaging>jarpackaging>


    <distributionManagement>
        <repository>
            <id>nexusid>
            <name>3rdPartyname>
            <url>http://127.0.0.1:8081/repository/3rdParty/url>
        repository>
    distributionManagement>
    <build>
        <defaultGoal>compiledefaultGoal>
    build>
project>

3.修改maven 安装目录下的config/setting.xml,新增

    <server>
      <id>nexusid>
      <username>adminusername>
      <password>admin123password>
    server>

4.打开命令行窗口,输入以下命令:

./mvn  deploy:deploy-file -DgroupId="com.yszd" -DartifactId=yszd-test -Dversion="2018.06.25" -Dpackaging=jar -Dfile=D:\yszd-test.jar -Durl=http://127.0.0.1:8081/repository/3rdParty/ -DrepositoryId=nexus

你可能感兴趣的:(Maven)