Saturday, November 29, 2014

Maven: Include a non-Maven standard library in pom

Suppose that our Maven project depends on a particular library such as ftp4j-1.2.7.jar, which is not listed by online maven repostiories such as or We can include the library in the following way to the pom file.

Next, designate a fake dependency for the jar, e.g.,

groupId: UNKNOWN
actifactId: ftp4j
version: 1.2.7.

Firstly, create a folder "lib" under the current project root directory and place the ftp4j-1.2.7.jar in the "lib/UNKNOWN/ftp4j/1.2.7/" folder.

Now in the pom, create <remote repository> whose url is local (the url points to the "lib" folder):


Finally we can add the ftp4j.jar as a dependency:


No comments:

Post a Comment