mvn install jar包 两种方式
安装指定文件到本地仓库命令:mvn install:install-file -DgroupId=<groupId> : 设置上传到仓库的包名 -DartifactId=<artifactId> : 设置该包所属的模块名 -Dversion=1.0.0 : 设置该包的版本号 -Dpackaging=jar : 设置该包的类型(很显然jar包) -Dfile=<myfile.jar> : 设置该jar包文件所在的路径与文件名 -Dmaven.repo.local=<repositoryFile> : 安装该jar包文件到mavne仓库的路径
1.不指定仓库
mvn install:install-file -DgroupId=xx.xx.xx(jar包的groupId) -DartifactId=xx(jar包的artifactId) -Dversion=1.0.0(jar的版本号) -Dpackaging=jar -Dfile=D:\xx\xx-1.0.0.jar(jar包的具体路径)
mvn install:install-file -Dmaven.repo.local=E:\repository -Dfile=D:\Desktop\ojdbc6-11.2.0.1.0.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.1.0 -Dpackaging=jar
2.指定仓库位置
多了 -Dmaven.repo.local=xx\repository(仓库位置)
mvn install:install-file -DgroupId=xx.xx.xx(jar包的groupId) -DartifactId=xx(jar包的artifactId) -Dversion=1.5.0(jar的版本号) -Dpackaging=jar -Dfile=D:\xx\xx-1.5.0.jar(jar包的具体路径)-Dmaven.repo.local=E:\repository (选填,仓库的位置)
如
mvn install:install-file -Dmaven.repo.local=E:\repository -Dfile=E:\Desktop\framework-foundation-0.1.0-TEST-SNAPSHOT-classes.jar -DgroupId=com.newtouch -DartifactId=module-parent -Dversion=0.0.1-TEST-SNAPSHOT -Dpackaging=jar