You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2006/04/20 17:14:51 UTC
svn commit: r395616 - in /maven/site/trunk/src/site/apt/examples: ./
injecting-properties-via-settings.apt
Author: jdcasey
Date: Thu Apr 20 08:14:49 2006
New Revision: 395616
URL: http://svn.apache.org/viewcvs?rev=395616&view=rev
Log:
Adding example for injecting properties via settings-declared profile.
Added:
maven/site/trunk/src/site/apt/examples/
maven/site/trunk/src/site/apt/examples/injecting-properties-via-settings.apt (with props)
Added: maven/site/trunk/src/site/apt/examples/injecting-properties-via-settings.apt
URL: http://svn.apache.org/viewcvs/maven/site/trunk/src/site/apt/examples/injecting-properties-via-settings.apt?rev=395616&view=auto
==============================================================================
--- maven/site/trunk/src/site/apt/examples/injecting-properties-via-settings.apt (added)
+++ maven/site/trunk/src/site/apt/examples/injecting-properties-via-settings.apt Thu Apr 20 08:14:49 2006
@@ -0,0 +1,63 @@
+ ---
+ Example: Injecting POM Properties via Settings.xml
+ ---
+ John Casey
+ ---
+ 20-Apr-2006
+ ---
+
+Example: Injecting POM Properties via Settings.xml
+
+* Impetus
+
+ You have a plugin parameter that should contain a user-specific value. This
+ parameter has a common format (relative directory structure), but depends on
+ knowing the directory of the installed application or something.
+
+* Plugin Configuration
+
++---+
+<project>
+ [...]
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.myproject.plugins</groupId>
+ <artifactId>my-cool-maven-plugin</artifactId>
+ <configuration>
+ <deploymentDirectory>${application-home}/deploy</deploymentDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
++---+
+
+* <<<settings.xml>>>
+
++---+
+<settings>
+ [...]
+ <profiles>
+ <profile>
+ <id>inject-application-home</id>
+ <properties>
+ <application-home>/path/to/application</application-home>
+ </properties>
+ </profile>
+ </profiles>
+
+ <activeProfiles>
+ <activeProfile>inject-application-home</id>
+ </activeProfiles>
+</settings>
++---+
+
+* Explanation
+
+ When Maven loads the project's POM, it will pickup the activated profiles from
+ the <<<activeProfiles>>> section of the <<<settings.xml>>> file, and inject the
+ properties declared within the profile. When the POM is interpolated, the
+ <<<application-home>>> property will already have been injected, so will allow
+ the plugin's parameter value to be resolved.
+
+
Propchange: maven/site/trunk/src/site/apt/examples/injecting-properties-via-settings.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/site/trunk/src/site/apt/examples/injecting-properties-via-settings.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"