
What is it?
This post will be about automatic assembly systems. I think it is intuitively clear what it is and why it is needed, but for formality it is necessary to write - these are software products that, based on some configuration, can “assemble” your project.
Under the word "collect" there can be a very extensive amount of work that, with the "manual" approach, requires a considerable amount of time.
A small list for clarity:
- Download dependent libraries for your project from the network (repository);
- compile the module classes or the entire project;
- generate additional files: SQL scripts, XML-configs, etc .;
- delete / create directories and copy the specified files into them;
- packaging of compiled project classes in archives of various formats: zip, rar, rpm, jar, ear, war, etc .;
- compilation and launch of unit tests (unit-test) of your project with the results of tests and calculating the percentage of coverage;
- installation (deploy) of project files on a remote server;
- generation of documentation and reports.
The most popular representatives of such systems are Ant + Ivy, Maven.
Confusion
There are a number of articles about Maven on the hub, but, unfortunately, they are all in different hubs, because There is no separate hub for build systems.
Therefore, I decided “not to be like everyone else” and choose the common hub “Programming”, and not “Java”, “Web development”, etc.
Therefore, an uninterested reader can continue his search for something interesting, but an interested reader can read more.
I specifically started the post with explanations and descriptions of features, since these systems can do assemblies not only for “Java” and are applicable not only in web development. The possibilities and options for using these systems are much wider.
')
In the end, they may not even compile the code at all, but do automatic routine work: generation, archiving, file operations, installation on the server — which allows developers
to spend their time more efficiently .
High-level architecture
The architecture of all build-systems is as follows:
- configurations
- own configuration where “personal” system settings are stored. For example, such as information about the installation site or environment, information about repositories, and so on;
- the configuration of the module, which describes the location of the project, its dependencies and the tasks that need to be performed for the project;
- configuration parsers
- a parser capable of “reading” the configuration of the system itself, to configure it accordingly;
- module configuration parser, where some “human-understandable” terms describe tasks for an assembly system;
- the system itself is a utility + script for launching it in your OS, which, after reading all the configurations, will begin to perform one or another algorithm necessary for the implementation of the running task;
- plug-in system - additional plug-in add-ons for the system, which describe algorithms for implementing typical tasks;
- Local repository - a repository located on the local machine for caching the requested files on remote repositories.
For people unfamiliar with terminology: the repository is some structured storage of some data. For example, various auxiliary libraries / plugins / scripts / documentation / source, etc.
This concludes the general part of the build-systems and move on to more specific things.
Maven
Since rewriting what others have written would be wrong, I’ll provide a list of articles on the topic that already exist on the Maven website and where it is described specifically about this system - what it is, how it works and what principles it is based on.
I advise you to read in this order:
- Maven - why? - introductory article about Maven, which describes how the configuration of the module / project, the life cycle of the assembly.
- Apache Maven - basics - terminology, installation, assembly, creating a project from the archetype, useful links
- Maven - automation of the project assembly - a more detailed description of the assembly life cycle, description of the settings of the diploma (deploy), using the installation example for a Tomcat server.
- Creating your own archetypes and directories in Maven is for people already “in the subject line” and wanting to create their own archetypes, if for some reason the existing ones are not enough. The process is described in some detail.
Conclusion
The purpose of this article was to convey to the reader information about the assembly systems as a whole, why they are needed and what tasks they are capable of performing.
I take my leave of it and hope that this article will find its reader who is not afraid to use such systems for their daily tasks, and will show the simplicity and efficiency of project building systems.
Continued:
Build Systems - Local Repository