forked from xaniox/set-property-maven-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic usage information
- Loading branch information
matzefratze123
committed
Apr 26, 2015
1 parent
baf3efc
commit 7467fbf
Showing
1 changed file
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,64 @@ | ||
# set-property-maven-plugin | ||
Set project variables dynamically while building a maven project | ||
**Set project properties dynamically while building a maven project** | ||
|
||
This plugin intends to help out other plugins by defining project properties via build-time. | ||
Add the following to your pom to use the plugin: | ||
|
||
``` | ||
<pluginRepositories> | ||
<repository> | ||
<id>matzes-repo</id> | ||
<url>http://matzefratze123.de/artifactory/release</url> | ||
</repository> | ||
</pluginRepositories> | ||
``` | ||
|
||
The plugin only provides one goal: set-properties | ||
This goal evaluates a condition and decides based on the configuration which properties need to be set. | ||
|
||
Example configuration: | ||
|
||
``` | ||
<plugin> | ||
<groupId>de.matzefratze123</groupId> | ||
<artifactId>set-property-maven-plugin</artifactId> | ||
<version>1.0.1</version> | ||
<executions> | ||
<execution> | ||
<id>execution-id</id> | ||
<!-- Default phase is 'validate' if not specified --> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>set-properties</goal> | ||
</goals> | ||
<configuration> | ||
<operations> | ||
<operation> | ||
<!-- This is the condition for which it compares the string with another string --> | ||
<!-- In this example it compares the pom's version and checks wether it's a snapshot or not --> | ||
<condition> | ||
<string>${project.version}</string> | ||
<operator>EQUALS_REGEX</operator> | ||
<operand>.*-SNAPSHOT</operand> | ||
</condition> | ||
<!-- Define properties to be set when the condition above is true --> | ||
<setpropertiestrue> | ||
<setproperty> | ||
<property>deploy.url</property> | ||
<value>http://example.com/snapshots</value> | ||
</setproperty> | ||
</setpropertiestrue> | ||
<!-- Define properties to be set when the condition above is false --> | ||
<setpropertiesfalse> | ||
<setproperty> | ||
<property>deploy.url</property> | ||
<value>http://example.com/releases</value> | ||
</setproperty> | ||
</setpropertiesfalse> | ||
</operation> | ||
</operations> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
``` |