Skip to content

Commit d40443a

Browse files
committed
Version 0.9.0
ID-22: Add support for multiple property files ID-23: Fix passphrase bug for gateway 7.6.2 ID-24: Use logging for Python scripts instead of 'print'
1 parent 3327ff7 commit d40443a

File tree

21 files changed

+378
-147
lines changed

21 files changed

+378
-147
lines changed

CHANGELOG.adoc

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,56 @@
11
= Changelog
22

3+
== Version 0.9.0
4+
[cols="1,2,<10a", options="header"]
5+
|===
6+
|ID|Type|Description
7+
|https://github.com/Axway-API-Management-Plus/apigw-maven-plugin/issues/22[#22]
8+
|Fix
9+
|Broken passphrase feature for API Gateway 7.6.2 is fixed.
10+
11+
|https://github.com/Axway-API-Management-Plus/apigw-maven-plugin/issues/23[#23]
12+
|Enhancement
13+
|Support for multiple property files.
14+
15+
Additionally to the `axway.config.props` property, property files can be configured via the <configuration> element of the <plugin> element or via the `axway.config.props.files` property.
16+
17+
.pom.xml
18+
[source,xml]
19+
----
20+
<plugin>
21+
<groupId>com.axway.maven.plugins</groupId>
22+
<artifactId>apigw-maven-plugin</artifactId>
23+
<version>${axway.maven.plugin.ver}</version>
24+
<extensions>true</extensions>
25+
<configuration>
26+
<configPropertyFiles> <!--1-->
27+
<configPropertyFile>${basedir}/a.json</configPropertyFile>
28+
<configPropertyFile>${basedir}/b.json</configPropertyFile>
29+
</configPropertyFiles>
30+
</configuration>
31+
</plugin>
32+
----
33+
<1> Configure multiple property files.
34+
35+
.command line
36+
....
37+
$ mvn package -Daxway.config.props.files=c.json,d.json
38+
....
39+
40+
The files are used in the following order:
41+
42+
1. File specified by `axway.config.props` property.
43+
1. Files specified in the <configuration> element.
44+
1. Files specified by `axway.config.props.files` property.
45+
46+
If a property exists in the multiple property files the value of from the last property file is used.
47+
48+
|https://github.com/Axway-API-Management-Plus/apigw-maven-plugin/issues/24[#24]
49+
|Enhancement
50+
|Use Python logging for `buildfed`` tool.
51+
52+
|===
53+
354
== Version 0.8.1
455
[cols="1,2,<10a", options="header"]
556
|===

doc/getting-started/getting-started.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:sectnums:
66
:source-highlighter: prettify
77

8-
:mvn-plugin-ver: 0.8.1
8+
:mvn-plugin-ver: 0.9.0
99

1010
Here you get a simple introduction on how to use the _Maven Plugin for Axway API Gateway_.
1111
It assumes that you are familiar with https://maven.apache.org[Apache Maven] and that you are familiar with PolicyStudio and the API Gateway.

doc/manual/_config-tool.adoc

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Options:
3434
Path of policy archive (.pol)
3535
-c FILEPATH, --config=FILEPATH
3636
Path of JSON configuration file
37-
--prop=FILEPATH Path of JSON property file [optional]
37+
--prop=FILEPATH Path of JSON property file [multiple]
3838
--cert=FILEPATH Path of JSON certificate configuration file [optional]
3939
--cert-expiration=DAYS
4040
Check if certificates expire within the next days
@@ -78,7 +78,10 @@ The option is mandatory.
7878
The option is mandatory.
7979

8080
|--prop
81-
|An optional JSON file containing the property configuration.
81+
|Path to a JSON file containing the property configuration.
82+
Multiple files are supported by specifying the parameter multiple times.
83+
84+
If a property occurs in multiple files the value from the last file is used.
8285

8386
|--cert
8487
|An optional JSON file containing the certificate configuration.
@@ -105,6 +108,7 @@ If missing, no `.env` file is generated.
105108
|--define
106109
|Define a system property `name:value`.
107110
System properties can be used instead of custom defined properties.
111+
Multiple properties are supported by specifying the parameter multiple times.
108112

109113
|--passphrase-in
110114
|Passphrase for source archives.
@@ -144,34 +148,7 @@ Following kind of configuration files are supported:
144148

145149
* Environmentalized fields: Mandatory configuration file for environmentalized fields.
146150
* Certificates: Optional configuration file for certificates.
147-
* Properties: Optional configuration file for properties.
148-
149-
The location of the mandatory configuration file for environmentalized fields is implicitly set to `${basedir}/src/main/axwgw/gateway.config.json`.
150-
151-
The file will be created during the initialization of the project (goal `apigw:init`).
152-
153-
The location of the other configuration files can be specified in the `<configuration>` element of the plugin (see below).
154-
155-
.pom.xml
156-
[source,xml,subs="verbatim,attributes"]
157-
----
158-
<!- ... ->
159-
<plugin>
160-
<groupId>com.axway.maven.plugins</groupId>
161-
<artifactId>apigw-maven-plugin</artifactId>
162-
<version>{mvn-plugin-ver}</version>
163-
<extensions>true</extensions>
164-
<configuration>
165-
<certsFile>${basedir}/src/main/axwgw/gateway.certs.json</certsFile> <!--1-->
166-
<propertyFile>${basedir}/gateway.prop.json</propertyFile> <!--2-->
167-
</configuration>
168-
</plugin>
169-
<!- ... ->
170-
----
171-
<1> Optional location of the configuration file for certificates.
172-
<2> Optional location of the configuration file for properties.
173-
174-
NOTE: The configuration of the config files is only applicable for deployment projects.
151+
* Properties: Optional configuration files for properties.
175152

176153
=== Environmentalized Fields
177154

doc/manual/_reference.adoc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@ Default: _none_
241241

242242
Default: _none_
243243

244+
|axway.config.props.files
245+
|Comma separated path to configuration files for properties.
246+
247+
Default: _none_
248+
244249
|axway.tools.cfg.verbose
245250
|Set to _true_ to enable verbose mode for internal configuration tool.
246251

@@ -309,3 +314,36 @@ Default: false
309314

310315
NOTE: It is not checked if the source files are newer than the target artifact.
311316
|===
317+
318+
== Plugin Configuration
319+
320+
The plugin can also be configured in the `pom.xml` via the <configuration> element of the plugin.
321+
322+
.pom.xml
323+
[source,xml,subs="verbatim,attributes"]
324+
----
325+
<!- ... ->
326+
<plugin>
327+
<groupId>com.axway.maven.plugins</groupId>
328+
<artifactId>apigw-maven-plugin</artifactId>
329+
<version>{mvn-plugin-ver}</version>
330+
<extensions>true</extensions>
331+
<configuration>
332+
<configConfigFile>${basedir}/src/main/axwgw/gateway.config.json</configConfigFile> <!--1-->
333+
334+
<configCertsFile>${basedir}/src/main/axwgw/gateway.certs.json</configCertsFile> <!--2-->
335+
336+
<configPropertyFile>${basedir}/gateway.prop.json</configPropertyFile> <!--3-->
337+
338+
<configPropertyFiles> <!--4-->
339+
<configPropertyFile>${basedir}/prop-a.json</configPropertyFile>
340+
<configPropertyFile>${basedir}/prop-b.json</configPropertyFile>
341+
</configPropertFiles>
342+
</configuration>
343+
</plugin>
344+
<!- ... ->
345+
----
346+
<1> Location of the configuration file for environmentalized fields.
347+
<2> Location of the configuration file for certificates.
348+
<3> Location of a configuration file for properties.
349+
<4> Location of a list of configuration files for properties.

doc/manual/_usage.adoc

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ For deployment following properties are used:
232232
|`axway.config.props`
233233
|Path to properties configuration file.
234234
|no
235+
236+
|`axway.config.props.files`
237+
|Comma separated list of paths to properties configuration files.
238+
|no
235239
|===
236240

237241
Example:
@@ -268,6 +272,104 @@ Steps:
268272
. Execute `package` lifecycle.
269273
. Deploy `.fed` package to gateway
270274

275+
== Configuration Files
276+
277+
The location of configuration files can be specified via the <configuration> element of the plugin or via Maven properties or via the `-D` parameter of the Maven command line.
278+
279+
=== Environmentalized Fields
280+
281+
.pom.xml
282+
[source,xml,subs="verbatim,attributes"]
283+
----
284+
<!- ... ->
285+
<plugin>
286+
<groupId>com.axway.maven.plugins</groupId>
287+
<artifactId>apigw-maven-plugin</artifactId>
288+
<version>{mvn-plugin-ver}</version>
289+
<extensions>true</extensions>
290+
<configuration>
291+
<configConfigFile>${basedir}/src/main/axwgw/gateway.config.json</configConfigFile> <!--1-->
292+
</configuration>
293+
</plugin>
294+
<!- ... ->
295+
----
296+
<1> Location of the configuration file for environmentalized fields.
297+
298+
.Command Line
299+
....
300+
$ mvn package -Daxway.config.envs=gateway.config.json
301+
....
302+
303+
=== Certificates
304+
305+
.pom.xml
306+
[source,xml,subs="verbatim,attributes"]
307+
----
308+
<!- ... ->
309+
<plugin>
310+
<groupId>com.axway.maven.plugins</groupId>
311+
<artifactId>apigw-maven-plugin</artifactId>
312+
<version>{mvn-plugin-ver}</version>
313+
<extensions>true</extensions>
314+
<configuration>
315+
<configCertsFile>${basedir}/src/main/axwgw/gateway.certs.json</configCertsFile> <!--1-->
316+
</configuration>
317+
</plugin>
318+
<!- ... ->
319+
----
320+
<1> Location of the configuration file for certificates.
321+
322+
.Command Line
323+
....
324+
$ mvn package -Daxway.config.certs=gateway.certs.json
325+
....
326+
327+
=== Configure Properties
328+
329+
The Maven plugin supports three options to specify configuration properties:
330+
331+
1. Embedded in the configuration files for environmentalized fields or for certificates.
332+
1. Via a configuration file specified by the property `axway.config.props` or via the <configPropertyFile> element in the <configuration> element of the plugin. This is the _master_ configuration file.
333+
1. Via configuration files specified by the <configPropertyFiles> element in the <configuration> element of the plugin.
334+
1. Via configuration files specified by a comma separated list of the property `axway.config.props.files`. These are called the _additionally_ configuration files.
335+
336+
Properties are read in the order listed above.
337+
If a property exists in multiple configuration files the value of the latest configuration file is used.
338+
339+
For deployment projects, the location of the mandatory configuration file for environmentalized fields is implicitly set to `${basedir}/src/main/axwgw/gateway.config.json`.
340+
The file will be created during the initialization of the project (goal `apigw:init`).
341+
342+
The location of the configuration files can be specified in the `<configuration>` element of the plugin (see below) or can be passed via the command line.
343+
344+
Examples:
345+
346+
.pom.xml
347+
[source,xml,subs="verbatim,attributes"]
348+
----
349+
<!- ... ->
350+
<plugin>
351+
<groupId>com.axway.maven.plugins</groupId>
352+
<artifactId>apigw-maven-plugin</artifactId>
353+
<version>{mvn-plugin-ver}</version>
354+
<extensions>true</extensions>
355+
<configuration>
356+
<configPropertyFile>${basedir}/gateway.prop.json</configPropertyFile> <!--1-->
357+
<configPropertyFiles> <!--2-->
358+
<configPropertyFile>${basedir}/prop-a.json</configPropertyFile>
359+
<configPropertyFile>${basedir}/prop-b.json</configPropertyFile>
360+
</configPropertFiles>
361+
</configuration>
362+
</plugin>
363+
<!- ... ->
364+
----
365+
<1> Location of a configuration file for properties.
366+
<2> Location of a list of configuration files for properties.
367+
368+
.Command Line
369+
....
370+
$ mvn package -Daxway.config.props=a.json -Daxway.config.props.files=b.json,c.json
371+
....
372+
271373

272374
== Miscellaneous
273375

doc/manual/user-guide.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ifdef::env-github[]
1818
:warning-caption: :warning:
1919
endif::[]
2020

21-
:mvn-plugin-ver: 0.8.1
21+
:mvn-plugin-ver: 0.9.0
2222

2323
== About the Plugin
2424

example/config-tool/README.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ In this example the `buildfed` tool will be invoked with the following parameter
101101
* `-p src\gateway.pol`: specifies the path to the input `.pol` archive
102102
* `-c config\gateway.config.json`: specifies the path to the environmentalized fields configuration file
103103
* `--cert=config/gateway.certs.json`: specifies the path to the certificates configuration file
104-
* `--prop=config/gateway.props.json`: specifies the path to the properties file
104+
* `--prop=config/gateway.props.json`: specifies the path to a properties file
105+
* `--prop=config/passwords.props.json`: specifies the path to a second properties file
105106
* `--output-fed=gateway.fed`: specifies the path for the configured `.fed` archive
106107
* `--passphrase-in=changeme`: passphrase for input archives (`.pol` and `.env`)
107108
* `--passphrase-out=changed`: passphrase for the generated `.fed` file

example/config-tool/config/gateway.config.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"fields": {
66
"attributeValue#0": {
7-
"property": "artifact",
7+
"property": "artifact",
88
"type": "string",
99
"used": true,
1010
"value": null
@@ -21,21 +21,21 @@
2121
"value": null
2222
}
2323
}
24-
},
24+
},
2525
"/[NetService]name=Service/[HTTP]name=Default Service/[SSLInterface]name=HTTPS": {
2626
"description": "",
2727
"fields": {
2828
"address#0": {
29-
"property": null,
30-
"type": "string",
31-
"used": true,
32-
"value": "localhost"
29+
"property": "service.address",
30+
"type": "string",
31+
"used": true,
32+
"value": null
3333
},
3434
"port#0": {
35-
"property": null,
35+
"property": "service.port",
3636
"type": "string",
3737
"used": true,
38-
"value": "18443"
38+
"value": null
3939
}
4040
}
4141
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"properties": {
3-
"cert.password.staged.server": "changeme"
3+
"service.address": "localhost",
4+
"service.port": "18443"
45
}
56
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"properties": {
3+
"cert.password.staged.server": "changeme"
4+
}
5+
}

0 commit comments

Comments
 (0)