Java library management with Maven

Using Maven, the library management is as intuitive as it could ever be.  "DLL hell" headache is over by specifying the version of the library in the project pom.xml file.  Furthermore, all JAR files are managed and stored locally as any requests are made by the project.

Maven configuration is specified in a file called POM, specified in pom.xml.  This XML formatted file specify all that the compiler would need, including the package configuration and libraries.

If you are not using Maven and copying the Complex library JAR file into your project library, the library management is manual.  Which means, you would have the same copy of the JAR files all over the place for whichever project that needs it.  If the library is updated, you would download the updated file for all the projects that use the library.

Supposing you have Complex library and your projects Mandelbrot and Misiurewicz  need that library. Using Maven, incorporating that library is as simple as it could be.  Edit pom.xml and specify dependency in your pom.xml file.  As you compile the project, the Complex library JAR files will be stored and managed locally.

Now you want compile Misiurewicz project that uses Complex library.  Edit your pom.xml file for the project, and the Complex library is available locally without copying the files into the project.

All can be managed by Maven.

Edit pom.xml for generating an excutable JAR.  Specify the main class. Specify jar-with-dependencies and all the necessary JAR files will be included in the generated executable JAR file.

> mvn package

Comments

Popular posts from this blog

Logging your Maven project with Logback

TreeEditor: Customizing Drag and Drop

Spring Tool Suite