What is Assembly in Maven?

The Assembly Plugin for Maven enables developers to combine project output into a single distributable archive that also contains dependencies, modules, site documentation, and other files. Your project can easily build distribution “assemblies” using one of the prefabricated assembly descriptors.

What is extension in Maven?

A Maven extension is a library that goes into Maven Core classloader, then is really in the core execution of Maven, unlike a plugin that runs in a child classloader separated from other plugins.

What is assembly descriptor?

The assembly descriptor is an XML-based configuration, which defines how to build an assembly and how its content should be structured.

Why do we need maven Assembly plugin?

The assembly maven plugin comes out of the box with some predefined descriptors, let´s see it: jar-with-dependencies -> Allow us to generate a jar package with all the dependencies defined in pom. xml file inside of it. This is useful when we plan to deliver an auto-executable jar.

What is project Basedir in maven?

project. basedir : The directory that the current project resides in. This means this points to where your Maven projects resides on your system. It corresponds to the location of the pom. xml file.

What is extension in Pom?

Extensions are a way to add libraries to Core Classloader. Extensions are typically used to enable Wagon providers, used for the transport of artifact between repositories, and plug-ins which provide lifecycle enhancements.

What is an Uberjar?

An uber-JAR—also known as a fat JAR or JAR with dependencies—is a JAR file that contains not only a Java program, but embeds its dependencies as well. This means that the JAR functions as an “all-in-one” distribution of the software, without needing any other Java code.

How to include Maven assembly plugin in build?

Include the maven-assembly plugin in the build: Create the kit.xml in src/main/assembly and specify in the file inclusion. Here’s my kit.xml: As you can see, the assembly descriptor has a “files” section, which is what does the trick for us.

What does Assembly descriptor mean in Apache Maven?

This descriptor specifies the type of assembly archive to create, the contents of the assembly, and the ways in which dependencies or its modules are bundled with an assembly. An assembly defines a collection of files usually distributed in an archive format such as zip, tar, or tar.gz that is generated from a project.

What does ” exclude ” mean in Apache Maven Assembly?

If none is present, then represents all valid values. (Many) When subelements are present, they define a set of files and directory to exclude. If none is present, then represents no exclusions. Similar to a UNIX permission, sets the file mode of the files included.

How are multimodule builds handled in Maven?

As you are no doubt aware, Maven introduces advanced handling of multimodule builds. These are builds which contain multiple, often interrelated projects. In these builds, project hierarchy is established through use of the modules section of the POM, where parent POMs specify their children in a modules section.