Member-only story
How to add a custom dependency JAR in Apache Maven — English
Maven is a popular open source project under Apache Foundation, and it is also a Java build tool along side Apache Ant and Apache Gradle. In this blog, I will explain how you can add a custom JAR file in Maven.
Maven has a concept called dependency, and there might be a time that you encounter an error like this when you try to add a dependency through its pom.xml configuration file:
Missing artifact? What does this even mean? Well, artifact in Maven’s world typically refers a library that is almost always Java JAR file. For most commonly used tools from Apache and Spring, these files can be found under a common public repository. For example the most well known public repository is athttp://search.maven.org. When Maven asks you add a dependency, this, thus, means to add a required library. And a typical library can be specified as a form of dependency, and its signature is usually consisted of at lease these three properties:
- groupId
- artifactId
- version
In another word, as long as you can provide these three properties as a form of a dependency, you can pretty much pull any library into your project.
But what if you need to import a custom JAR file that is not publicly available? Or, what…