maven仓库下载不了?将本地jar包安装进入maven仓库

xiaoxiao2021-02-28  68

实际项目中pom.xml依赖写法:

<dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>3.1.0.RELEASE</version> </dependency> Maven 安装 JAR 包的命令是:

mvn install:install-file -Dfile=jar包的位置 -DgroupId=上面的groupId -DartifactId=上面的artifactId -Dversion=上面的version -Dpackaging=jar 例如我的这个spring-context-support-3.1.0.RELEASE.jar 文件放在了"D:\mvn\"中 则命令为(在cmd中执行):

mvn install:install-file -Dfile=D:\mvn\spring-context-support-3.1.0.RELEASE.jar -DgroupId=org.springframework -DartifactId=spring-context-support -Dversion=3.1.0.RELEASE -Dpackaging=jar 注意:路径和名称中不要有空格和中文,命令为一行,不要换行

转载请注明原文地址: https://www.6miu.com/read-68179.html

最新回复(0)