Skip to content

Commit

Permalink
[MRRESOURCES-134] Introduce aggregate goal instead of runOnlyAtExecut…
Browse files Browse the repository at this point in the history
…ionRoot parameter
  • Loading branch information
slawekjaranowski committed May 8, 2023
1 parent f1f79a1 commit 4fa1076
Showing 1 changed file with 107 additions and 81 deletions.
188 changes: 107 additions & 81 deletions src/site/apt/usage.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Usage

To turn on the bundle resource manifest generation you need to configure the plugin as follows:

-------------------
+---+
<project>
...
<build>
Expand All @@ -55,8 +55,8 @@ Usage
</build>
...
</project>
-------------------
+---+

This will trigger the scanning of that project's <<<$\{basedir}/src/main/resources>>> directory and create the
<<<$\{basedir}/target/classes/META-INF/maven/remote-resources.xml>>> {{{./remote-resources.html}manifest file}}.

Expand All @@ -69,7 +69,7 @@ Usage

To use remote resource bundles you need to configure the plugin as follows:

-------------------
+---+
<project>
...
<build>
Expand All @@ -96,7 +96,7 @@ Usage
</build>
...
</project>
-------------------
+---+

This will retrieve the <<<apache-jar-resource-bundle-1.0.jar>>> from the remote repositories
specified in your POM, process each resource in the bundle and deposit them in your projects
Expand All @@ -105,39 +105,47 @@ Usage

* Running Once in a Multi-Module Build

<<Note:>> This feature was added in version 1.1.
<<Note:>> The parameter <<<runOnlyAtExecutionRoot>>> was removed in version <<3.1.0>>
and was replaced by <<<aggregate>>> goal.

In many cases, an application build consists of multiple Maven modules, but you only need to
include the license files, dependencies listing, etc. once for the entire application. Of course,
in such cases, the dependencies listing needs to aggregate all dependencies of all modules.

To accomplish this, you can use the <<<runOnlyAtExecutionRoot>>> parameter when you configure
the Remote Resources Plugin in your application parent POM. This parameter limits execution of the
Remote Resources Plugin to the root directory in which the build was run. In most cases, the
application's distribution archives will be created at this top directory, so this is a natural
To accomplish this, you can use the <<<aggregate>>> goal when you configure
the Remote Resources Plugin in your application root POM.
You must configure execution with <<inherited>> set to <<false>> to limit execution only in root POM of your application.

In most cases, the application's distribution archives will be created at this top directory, so this is a natural
location into which licensing and dependency information should be generated.

To run the Remote Resources Plugin only in the execution root, use the following:
To run the Remote Resources Plugin only in the root of your project, use the following:

+---+
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>${project.version}</version>
[...]

<executions>
<execution>
<id>process-remote-resources</id>
<goals>
<goal>process</goal>
</goals>
<configuration>
<runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
[...]
</configuration>
</execution>
</executions>
</plugin>
<project>
...
<build>
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>${project.version}</version>
[...]

<executions>
<execution>
<id>process-remote-resources</id>
<inherited>false</inherited>
<goals>
<goal>aggregate</goal>
</goals>
<configuration>
[...]
</configuration>
</execution>
</executions>
</plugin>
</build>
...
</project>
+---+


Expand All @@ -154,24 +162,30 @@ Usage
configuration:

+---+
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>process-remote-resources</id>
<goals>
<goal>process</goal>
</goals>
<configuration>
<filterDelimiters>
<filterDelimiter>#{*}</filterDelimiter>
</filterDelimiters>
[...]
</configuration>
</execution>
</executions>
</plugin>
<project>
...
<build>
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>process-remote-resources</id>
<goals>
<goal>process</goal>
</goals>
<configuration>
<filterDelimiters>
<filterDelimiter>#{*}</filterDelimiter>
</filterDelimiters>
[...]
</configuration>
</execution>
</executions>
</plugin>
</build>
...
</project>
+---+

Notice the '<<<*>>>' character above. This denotes the dividing point between start and end delimiter, where the actual
Expand All @@ -181,24 +195,30 @@ Usage
delimiters for the format '<<<#expr#>>>', add the following to your plugin configuration:

+---+
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>process-remote-resources</id>
<goals>
<goal>process</goal>
</goals>
<configuration>
<filterDelimiters>
<filterDelimiter>#</filterDelimiter>
</filterDelimiters>
[...]
</configuration>
</execution>
</executions>
</plugin>
<project>
...
<build>
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>process-remote-resources</id>
<goals>
<goal>process</goal>
</goals>
<configuration>
<filterDelimiters>
<filterDelimiter>#</filterDelimiter>
</filterDelimiters>
[...]
</configuration>
</execution>
</executions>
</plugin>
</build>
...
</project>
+---+

When the filter processor executes and notices this delimiter specification missing a '<<<*>>>' character, it will simply
Expand All @@ -208,20 +228,26 @@ Usage
cases where this would cause trouble, you can disable these default delimiters as follows:

+---+
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>process-remote-resources</id>
<goals>
<goal>process</goal>
</goals>
<configuration>
<useDefaultFilterDelimiters>false</useDefaultFilterDelimiters>
[...]
</configuration>
</execution>
</executions>
</plugin>
<project>
...
<build>
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>process-remote-resources</id>
<goals>
<goal>process</goal>
</goals>
<configuration>
<useDefaultFilterDelimiters>false</useDefaultFilterDelimiters>
[...]
</configuration>
</execution>
</executions>
</plugin>
</build>
...
</project>
+---+

0 comments on commit 4fa1076

Please sign in to comment.