美文网首页
mvn 安装本地jar

mvn 安装本地jar

作者: huangxiongbiao | 来源:发表于2017-11-23 09:35 被阅读13次

将jar包安装到本地repository中

mvn install:install-file -Dfile=my-jar.jar -DgroupId=org.richard -DartifactId=my-jar -Dversion=1.0 -Dpackaging=jar

http://mvnrepository.com/中找到对应的jar:
以 spring-context-support-3.1.0.RELEASE.jar 为例,在 图中已经给出这个 jar 包的 groupId,artifactId,version信息,
手动安装的时候这些信息不要改,否则 Maven 项目移植的话,jar 包下载就会失败。顺便把这信息帖下面,方便对照:

<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

相关文章

网友评论

      本文标题:mvn 安装本地jar

      本文链接:https://www.haomeiwen.com/subject/nlwavxtx.html