maven怎样导入自己写的包

2025-03-12 16:10:04
推荐回答(1个)
回答1:

1 需要在pom.xml中,设置好自己的jar包信息。
下面为例子:

com.arr
xxxx
0.1


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了。