To depend on another library, you must declare the dependencies in your project’s pom.xml file. Maven is not only a build tool, but also a dependency management tool. The only relevant parts are the groupId, which by convention is something like the inverted domain name (similar to the Java package convention), the name of the artifact to build (it will be put into target/, under the name -.jar). The first 6 lines are of course just a way to say “Hi, Maven? How are you today? This is what I would like you to do…”. 4.0.0 org.mywebsite my-uber-library 2.0.0-SNAPSHOT What does it take to make a new Maven project? POM and directory structureĪll it really takes is a pom.xml file and a certain directory structure:
Many convenient IDEs (integrated development environments) including Eclipse, NetBeans and IntelliJ support Maven projects therefore, using Maven is an excellent choice when trying to let every developer choose their preferred development environment. It is Maven’s job to find and get them, no matter whether you just built them locally or not. This is where Maven comes in: you tell it that the dependencies are ImageJ, 3D Viewer and commons-math and what version(s) you require. You do not want to rebuild them from scratch unless you need to debug issues that are suspect bugs in said components.
Maven install file source download#
It can build dependencies from sources, but if the sources are not available, it will look into Maven repositories from which to download the dependencies.Įxample: let’s assume that you want to build a new plugin for ImageJ that builds on, say, the 3D Viewer and commons-math. Maven is a powerful tool to build Java projects and to manage their dependencies.