官网速度极慢,下面是我下好上传的大家可以下载使用链接:https://pan.baidu.com/s/1Ji5Orv3moXc60HRQ39y65Q
提取码:jiwx
nexus.exe /install <optional-service-name>  //安装nexus服务nexus.exe /start <optional-service-name>   //启动nexus服务
nexus.exe /stop <optional-service-name>    //停止nexus服务application-host : Nexus服务监听的主机 ;
application-port: Nexus服务监听的端口;
nexus-context-path : Nexus服务的上下文路径;默认的用户名为admin 密码为admin123
<distributionManagement>
        <repository>
            <id>nexus-releases</id>
            <name>Nexus Release Repository</name>
            <url>http://192.168.15.13:6689/repository/maven-releases/</url>
        </repository>
        <snapshotRepository>
            <id>nexus-snapshots</id>
            <name>Nexus Snapshot Repository</name>
            <url>http://192.168.15.13:6689/repository/maven-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
    <repositories>
        <repository>
            <id>nexus</id>
            <name>Nexus Repository</name>
            <url>http://192.168.15.13:6689/repository/maven-public/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        <repository>
            <id>3rdParty</id>
            <name>3rdParty</name>
            <url>http://192.168.15.13:6689/repository/3rdParty/</url>
        </repository>
        <repository>
            <id>aliyun-repos</id>
            <name>Aliyun Repository</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>sonatype-repos</id>
            <name>Sonatype Repository</name>
            <url>https://oss.sonatype.org/content/groups/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>sonatype-repos-s</id>
            <name>Sonatype Repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>nexus</id>
            <name>Nexus Plugin Repository</name>
            <url>http://192.168.15.13:6689/repository/maven-public/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
        <pluginRepository>
            <id>aliyun-repos</id>
            <name>Aliyun Repository</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>我们执行发布命令
mvn clean deploy 

No goals have been specified for this build
  <defaultGoal>compile</defaultGoal>
pom.xml文件<build>标签后面加上<defaultGoal>compile</defaultGoal>即可  

mvn deploy:deploy-file -DgroupId=xxx.xxx -DartifactId=xxx -Dversion=0.0.2 -Dpackaging=jar -Dfile=D:\xxx.jar -Durl=http://xxx.xxx.xxx.xxx:8081/repository/3rdParty/ -DrepositoryId=3rdParty
其中-DgroupId 为上传的jar的groupId
-DartifactId 为上传的jar的artifactId
-Dversion 为上传的jar的需要被依赖的时候的版本号
然后是-Dpackaging为jar,-Dfile为jar包路径 
-Durl 为要上传的路径,可以通过以下方式获取到
  mvn deploy:deploy-file -DgroupId=edu.ucar -DartifactId=grib -Dversion=4.3.19 -Dpackaging=jar -Dfile=F:\my3djar\grib-4.3.19.jar -Durl=http://192.168.15.13:6689/repository/3rdParty/ -DrepositoryId=3rdParty
最后在pom文件是配置这个第三库的代理
再把报错的依赖还原,更新maven (俗称手动更新依赖)
原文:https://www.cnblogs.com/ants_double/p/11345743.html