自建jar包自然不能从中央仓库中找到的,但是可以手动添加到本地仓库,这样也可以在maven中配置使用。
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了。