I have a java project project with several maven modules where I want to execute the exec plugin to execute a custom command after creating the Jars.
I call the maven: assembly exec: exec assembly on the parent POM to create the project output file.
In the parent POM, I used the following:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <configuration> <executable>myExecutable.exe</executable> <workingDirectory>${basedir}</workingDirectory> <arguments>....</arguments> </configuration> </plugin>
At the same time, my executable file was executed correctly, but it was executed for each child module.
To try to fix this, I found that the plugin does not receive child module inheritance:
<inherited>false</inherited>
But now, using the exec plugin , the parameters are executed 'for the target org.codehaus.mojo: exec-maven-plugin: 1.2.1: exec are absent or invalid .. p>
I tried to configure the plugin to run under the "executions" element and assign it to the maven life cycle phase. This made the executable work successfully, but I canโt do it because I need to execute other plugins (build plugin) before I run this exec plugin.
How can I run this (exec) plugin only once after the completion of the package phase, and the other plugin (build) was finished?
In other words, I want to execute a โpackageโ for all of my child modules, and then execute the exec plugin only once from the parent.
I would appreciate any help.