Maven导入本地的jar包
场景:在项目中pom文件中写有的依赖下载不下来时,我们需要在网上找到jar下载下来,再导入到maven仓库
项目中pom.xml依赖写法:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>
终端输入命令:
mvn install:install-file
-Dfile=E:\mvn\spring-context-support-3.1.0.RELEASE.jar
-DgroupId=org.springframework
-DartifactId=spring-context-support
-Dversion=3.1.0.RELEASE
-Dpackaging=jar
-DgeneratePom=true
解读:
-Dfile=本地jar包全路径
-DgroupId=pom文件中groupId
-DartifactId=pom文件中artifactId
-Dversion=pom文件中version
-Dpackaging=jar
-DgeneratePom= true (是否生成pom文件,ture:生成,false:不生成)