How to add local jar files to a Maven project?

后端 未结 30 3333
悲&欢浪女
悲&欢浪女 2020-11-21 04:58

How do I add local jar files (not yet part of the Maven repository) directly in my project\'s library sources?

30条回答
  •  被撕碎了的回忆
    2020-11-21 05:08

    Add your own local JAR in POM file and use that in maven build.

    mvn install:install-file -Dfile=path-to-jar -DgroupId=owngroupid -DartifactId=ownartifactid -Dversion=ownversion -Dpackaging=jar
    

    For example:

    mvn install:install-file -Dfile=path-to-jar -DgroupId=com.decompiler -DartifactId=jd-core-java -Dversion=1.2 -Dpackaging=jar
    

    Then add it to the POM like this:

提交回复
热议问题