How to add local jar files to a Maven project?

后端 未结 30 3376
悲&欢浪女
悲&欢浪女 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:18

    One way is to upload it to your own Maven repository manager (such as Nexus). It's good practice to have an own repository manager anyway.

    Another nice way I've recently seen is to include the Maven Install Plugin in your build lifecycle: You declare in the POM to install the files to the local repository. It's a little but small overhead and no manual step involved.

    http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html

提交回复
热议问题