Skip to content

Commit 876042c

Browse files
committed
Doc for new <customProperties> parameter
1 parent 5baca0a commit 876042c

2 files changed

Lines changed: 29 additions & 7 deletions

File tree

README.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,28 @@ add these repos to your `settings.xml` or your project `pom.xml`. Example:
8787
```
8888

8989

90-
## Configuration
91-
92-
You may configure the format for `build-tstamp` with the `tstampFormat`
93-
configuration option, using the pattern syntax defined by Java's [SimpleDateFormat](http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html). Example:
90+
## Configuration Parameters
91+
92+
<table>
93+
<tr>
94+
<th>Property</th>
95+
<th>Default</th>
96+
<th>Description</th>
97+
</tr>
98+
<tr>
99+
<td>tstampFormat</td>
100+
<td>yyyyMMddHHmmss</td>
101+
<td>Specify a custom format for the `build-tstamp` property. Use the pattern syntax defined by Java's [SimpleDateFormat](http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html)</td>
102+
</tr>
103+
<tr>
104+
<td>customProperties</td>
105+
<td>-</td>
106+
<td>Optional. A Clojure snippet of code that evaluates to a Map. You have locally define symbols for each `build-*` property. The Map returned is merged into the project properties. See below for examples.</td>
107+
</tr>
108+
</table>
109+
110+
111+
Example 1:
94112

95113
```xml
96114
<plugin>
@@ -101,14 +119,20 @@ configuration option, using the pattern syntax defined by Java's [SimpleDateForm
101119
<execution>
102120
<goals><goal>set-properties</goal></goals>
103121
<configuration>
122+
<!-- use only the day for the timestamp -->
104123
<tstampFormat>yyyy-MM-dd</tstampFormat>
124+
125+
<!-- Define a new project property 'build-tag-lowercase', based on 'build-tag'
126+
Note how 'build-tag' is available to the script as a local variable. -->
127+
<customProperties>
128+
{ :build-tag-lowercase (clojure.string/lower-case build-tag) }
129+
</customProperties>
105130
</configuration>
106131
</execution>
107132
</executions>
108133
</plugin>
109134
```
110135

111-
112136
# About git-describe
113137

114138
Before writing this plugin, I used to rely on a simple script which called `git

src/main/clojure/buildversion_plugin/mojo.clj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
props (.getProperties project)
3838
]
3939

40-
(log/warn (str "buildversion-plugin **** custom-versions map: " (pr-str custom-versions )))
41-
(log/warn (str "buildversion-plugin **** versions-map : " (pr-str versions-map )))
4240
(log/debug (str "buildversion-plugin - Setting properties: "))
4341
(doseq [[prop value] versions-map]
4442
(log/debug (str (name prop) ": " value))

0 commit comments

Comments
 (0)