How to include external jars in maven jar build process?

前端 未结 3 628
深忆病人
深忆病人 2020-12-18 18:51

I want to build a .jar file with dependencies in maven. Unfortunately I have to include some external .jars in my buildpath. When I now try to build this project with maven

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-18 19:28

    You need use below command to add external jar into .m2 folder

    mvn install:install-file -Dfile=[JAR] -DgroupId=[some.group] -DartifactId=[Some Id] -Dversion=1.0.0 -Dpackaging=jar
    

    This will add the given jar in to your .m2 folder. After that go to pom.xm and just add the dependency with given group id, artifact id and version.

提交回复
热议问题