安装本地包到本地仓库:


 

mvn install:install-file -DgroupId=com.xxx -DartifactId=mqtt-server-client -Dversion=1.0.1 -Dpackaging=jar -Dfile=E:\__vdt\MVVP\mqtt-server-client-1.0.1.jar -DpomFile=E:\__vdt\MVVP\pom.xml


 安装本地包到私有仓库:


 

mvn deploy:deploy-file -DgroupId=com.xxx -DartifactId=mqtt-server-client -Dversion=1.0.1 -Dpackaging=jar -Dfile=E:\__vdt\MVVP\mqtt-server-client-1.0.1.jar  -Durl=http://host:port/content/repositories/xxx-release/  -DrepositoryId=xxx-releases -DpomFile=E:\__vdt\MVVP\pom.xml



 如果私有仓库需要认证,在.m2/setting.xml文件中添加服务认证信息


 

<servers>
		<server>
			<id>xxx-release</id>
			<username>develop</username>
			<password>123456</password>
		</server>
</servers>



 指定的-DpomFile文件可以从包中提取出来。