📜 ⬆️ ⬇️

Apache maven 2

I decided to try to write something in my blog, so don’t scold too much if that;) I’m writing the first article about building and managing Apache Maven 2 Java projects. already with the details.

So what is Maven? Java developers are well aware of the Apache Ant utility. A fairly adequate replacement for the command line, but in order to add any new resources to the project, the compiled modules have to write more than one line in build.xml. Maven, on the other hand, pretty much reduces the number of steps to get the desired result.
The main idea of ​​Maven is that each project has a so-called object model (project object model, POM), which is described in the pom.xml file. Here you can see all the modules that the project uses, paths to repositories and much more. All you have to do is develop this object model and build the project using Maven. At the same time, it is not necessary to describe everything with an accuracy to the catalog - Maven "knows" how projects are usually built and he will find and assemble everything himself.
For even greater simplicity and speed of work, there are so-called archetypes - with their help, you can create a directory structure and an object model for a project automatically. There are already quite a few predefined archetypes in Maven that describe web applications, class libraries, J2EE applications, and more. In addition, you can easily create your own.
Very well organized work with repositories. If Maven does not find the module or plugin he needs in the local repository - he tries to download it from the Internet and then puts it to his local one.
With the help of plug-ins, Maven easily integrates into all the most popular IDEs (Eclipse, NetBeans, IDEA, JDeveloper). This greatly simplifies teamwork - each developer can work in his favorite IDE and not be afraid of the incompatibility of directories and project files.
It is also possible to generate a site that displays information about new releases of libraries.
Perhaps in short - that's all. If someone is interested - I can continue. In particular, I will describe in more detail the Maven architecture, the process of creating an application, the maintenance of a repository server, and integration into various IDEs.

')

Source: https://habr.com/ru/post/27327/


All Articles