Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven assembly plugin without separate descriptor xml file

Tags:

maven

I have a pom file with assembly plugin which uses

<descriptor>src/main/assembly/dist.xml</descriptor>

Is there any way I can add the information in dist.xml directly in the pom file and have only one file for Maven?

like image 560
ATOzTOA Avatar asked Mar 13 '13 05:03

ATOzTOA


People also ask

What is Maven Assembly descriptor?

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. <assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

What is Assembly single 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 fileset in Maven?

Defines the rules for matching and working with files in a given base directory. Element.

Where is Assembly XML?

The default location of assemblies. xml is in the project root directory.


2 Answers

It depends on what is present in dist.xml. If your assembly can be built with predefined descriptors and the configurations provided by the goal is sufficient, then you do not need a separate descriptor file.

The usage page of the maven assembly plugin has a few examples which show how it can be done.

like image 163
Raghuram Avatar answered Oct 10 '22 20:10

Raghuram


First the descriptor is marked as deprecated you should use descriptors instead. And no there is no possibility to define the descriptor within the pom.

like image 26
khmarbaise Avatar answered Oct 10 '22 19:10

khmarbaise