How do you look your best when partying? Why, you may be surprised!
What is this blog about? You ask. Well, today’s focus is on the process of creating complex code using Maven.
You already have a basic understanding of what Maven and Maven-Gradle are, especially when it comes to creating repositories with dependency information.
What if we say we want to use our project as a Gradle example to learn how to create a new Maven installation with a simple Maven plugin?
I am going to write this blog with a single Maven plugin
And then we will describe what a plugin really is, and the different benefits it can bring. Here are some examples:
create a new artifact
create an example of the artifact we are going to build
do some testing, adding some classes to a jar we’ve built
use a plugin to perform a few operations on our project
… and I am going to continue this post with more examples as time goes on.
Maven and Maven-Maven
Maven is a command-line, cross-platform and project-dependency manager for the Java platform. This means, Maven provides a mechanism to create, clone, update and uninstall projects that contain software, libraries, and tools, usually with a Java IDE (and in a future blog, a JUnit test runner…) in its package directory.
This way you can manage your project code by placing it in its own sub-directory from within a project. You also get a powerful command line interface, and you can even configure it from the command-line, which can be handy when doing any kind of complex tasks with all of your project’s dependencies.
You can install Maven 2.5 in your own Maven, as well as on your Maven server:
Note: Maven 1 and 2.5 were released over a year ago; this blog will only mention using the latest version.
Installing Maven is also quite easy within Eclipse and IntelliJ. For me personally I use Eclipse for that:
download the “Maven Repository” in the Eclipse repository, which is available both from within Eclipse as well as via mvn package , and as of this writing from a Maven PPA:
open a terminal, cd into your project and run the command: mvn package