前提:(1)maven安装好,并且配置到了环境变量 (2)maven的配置文件内做过修改,指定了远程仓库、用户名、密码,要有权限推送。
mvn deploy:deploy-file -Dfile=D:\component-trace-0.0.1-SNAPSHOT.jar -DgroupId=com.test.component -DartifactId=component-trace -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar -DrepositoryId=snapshots –Durl=http://xx.xx.x.xx/repository/maven-snapshots/
推送本地D盘的jar包component-trace-0.0.1-SNAPSHOT.jar到http://xx.xx.x.xx/repository/maven-snapshots/下,groupId等于com.test.component,artifactId等于component-trace,打包类型是jar
注意:http://xx.xx.x.xx地址可能带端口,可能不带。需要端口但是没写,会报超时错误。包版本需要带后缀-SNAPSHOT
其他:
1、mvn install:install-file -Dfile=D:\component-trace-0.0.1-SNAPSHOT.jar -DgroupId=com.test.component -DartifactId=component-trace -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar
将本地D盘的jar包component-trace-0.0.1-SNAPSHOT.jar注册到本地maven仓库,groupId等于com.test.component,artifactId等于component-trace,打包类型是jar
2、mvn -X 查看默认setting文件路径
3、mvn help:effective-settings 查看实际生效的setting内容