Skip to content

Commit

Permalink
Add documentation about plugin limitations
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Oct 22, 2023
1 parent 62ddbea commit b3aab51
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/site/apt/index.apt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,30 @@

Properties Maven Plugin

* Plugin limitations

Maven load project model (from pom.xml) for project and all submodules at startup time.
During project reading all available properties are resolved from projects and settings properties.

This plugin (as all other) is executed in the later phase - when project model is already build in memory.

So properties read from external files by this plugin can not by used in project definitions in items like
<<<\<goal\>>>>, <<<\<version\>>>> and so on.

Properties read by plugin in one module are not propagated to other modules or child projects.

Properties are only available for other plugins in runtime like for <<<maven-resource-plugin>>> for filtering resources.

In order to resolve such issue new features must by implement in Maven itself, like:

* {{{https://issues.apache.org/jira/browse/MNG-7833}MNG-7833}}

* {{{https://issues.apache.org/jira/browse/MNG-7914}MNG-7914}}

[]

* Plugin Overview

The Properties Maven Plugin is here to make life a little easier when dealing
with properties. It provides goals to read properties from files and URLs and write
properties to files, and also to set system properties.
Expand All @@ -24,7 +48,7 @@ Properties Maven Plugin
----------------------------------------

and invoke the {{{./read-project-properties-mojo.html}properties:read-project-properties}}
goal, it would be the same as declaring the following in your <pom.xml>:
goal, it would be similar (with described limitations) as declaring the following in your <pom.xml>:

----------------------------------------
<properties>
Expand All @@ -34,10 +58,7 @@ Properties Maven Plugin
----------------------------------------

The properties loaded from files or URLs can be used to filter resources
differently for different environments. Those using Spring's
{{{http://www.springframework.org/docs/api/org/springframework/beans/factory/config/PropertyResourceConfigurer.html}PropertyPlaceholderConfigurer}}
can see how these goals can be useful. Note that the URL format accepts
Spring's classpath: style pseudo-URL syntax.
differently for different environments.

Optionally, the plugin can process default values within property placeholders.

Expand Down

0 comments on commit b3aab51

Please sign in to comment.