Some files of the sub projects can be filtered, i.e. special tokens will be replaced by some other string before the actual build is started. In detail, the following files will be filtered:
The following example directory structure highlights the files which are filtered by the Invoker Plugin:
./ +- pom.xml +- src/ +- it/ +- settings.xml <- Filtered +- aggregator-project/ +- child-module-1/ | +- pom.xml <- Filtered +- child-module-2/ | +- pom.xml <- Filtered +- pom.xml <- Filtered +- invoker.properties <- Filtered +- goals.txt <- Filtered +- profiles.txt <- Filtered
Below is the corresponding POM snippet for the plugin configuration:
<project> <properties> <projectPropertyUsedForFiltering>another-value</projectPropertyUsedForFiltering> </properties> ... <build> <plugins> <plugin> <artifactId>maven-invoker-plugin</artifactId> <version>1.3</version> <configuration> <projectsDirectory>src/it</projectsDirectory> <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo> <pomIncludes> <pomInclude>*/pom.xml</pomInclude> </pomIncludes> <settingsFile>src/it/settings.xml</settingsFile> <filterProperties> <pluginPropertyUsedForFiltering>some-value</pluginPropertyUsedForFiltering> </filterProperties> </configuration> <executions> <execution> <id>integration-test</id> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
When filtering the files, the plugin searches various data sources for a token's replacement value in the order indicated below. The search terminates as soon as an existing replacement value has been found, i.e. the value is not null.
Built-in Property | Value | Since |
---|---|---|
localRepository | The absolute path to the local repository used for the main build. | 1.2 |
localRepositoryUrl | The file: URL to the local repository used for the main build. | 1.3 |
Tokens for which no replacement value could be determined will be left unchanged.