Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
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.
64 changes: 63 additions & 1 deletion README.md
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>
```

0 comments on commit 7467fbf

Please sign in to comment.