maven导入自己的jar包

运用maven的时候,并不是所有的jar包都会在中央仓库找到,有些是依赖于自己生成的jar包。

    这个时候,就需要自己手动加载到repo中。下面为简单的教程


1 需要在pom.xml中,设置好自己的jar包信息。

下面为例子:

<dependency>
<groupId>com.arr</groupId>
<artifactId>xxxx</artifactId>
<version>0.1</version>
</dependency>


2 把上面的信息填写好后,则需要使用命令进行安装操作

mvn install:install-file -DgroupId=com.arr   -DartifactId=arrow -Dversion=0.1  -Dfile=E:\jicheng\xxxx-0.1.0.jar    -Dpackaging=jar


DgroupId:pom.xml中的groupid

DartifactId:pom.xml中的artifactId

Dversion:pom.xml中的version

Dfile:jar包在本地中的路径

Dpackaging:包类型


3 上面的命令在cmd中操作完成后,就可以在repository中查看到jar了。

猜你喜欢

转载自blog.csdn.net/suleil1/article/details/80379825