Maven assembly - invoke module assembly

I have a basic pom.xml that has several modules. These modules must create their own assemblies and have a built-in module and XML descriptor defined in their pom.xml.

Is it possible to call module assemblies from the main pom.xml?

+3
source share
1 answer

If the assembly plugin is tied to the life cycle phase, it will be executed when the project is built no matter how the assembly starts.

To link execution, you should do something like below. The phase you are binding to depends on what your assembly is doing. See Introduction to the Build Life Cycle for the steps available:

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <executions>
    <execution>
      <id>assemble</id>
      <phase>package</phase>
      <goals>
        <goal>assembly</goal>
      </goals>
    <execution>
  </executions>
  <configuration>
    ...
  </configuration>
</plugin>

. profile, , . ( , , "", ).

+3

Source: https://habr.com/ru/post/1715730/


All Articles