Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute maven assembly plugin only on child POMs

I have a project with a parent POM and three child projects with.I want to execute the goal assembly:assembly only on one child POM. I already read the following post, but I didn't get it to work with the maven assembly plugin.

Execute Maven plugin goal on child modules, but not on parent

If I run

mvn -DskipTests=true assembly:assembly

I get the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:assembly (default-cli) on project inhouse: Error reading assemblies: No assembly descriptors found. -> [Help 1]

It seems that it always parses the plugin configuration and looks for the assembly descriptor, even then, if I do not put the plugin into the parent POM at all. Has anyone a solution for the assembly plugin?

like image 441
markus Avatar asked Sep 17 '25 20:09

markus


2 Answers

the rigth option is : <skipAssembly>true</skipAssembly> in order to skip the parent project.

like image 92
mohamedf Avatar answered Sep 20 '25 16:09

mohamedf


you can define in parent pom properties

<assembly.skipAssembly>true</assembly.skipAssembly>

and overwritte this property in your module pom properties

<assembly.skipAssembly>false</assembly.skipAssembly>
like image 21
danipenaperez Avatar answered Sep 20 '25 16:09

danipenaperez