Skip to content

Commit

Permalink
Version 0.9.0
Browse files Browse the repository at this point in the history
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'
  • Loading branch information
mlookaxw committed Oct 31, 2019
1 parent 3327ff7 commit d40443a
Show file tree
Hide file tree
Showing 21 changed files with 378 additions and 147 deletions.
51 changes: 51 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
= Changelog

== Version 0.9.0
[cols="1,2,<10a", options="header"]
|===
|ID|Type|Description
|https://github.com/Axway-API-Management-Plus/apigw-maven-plugin/issues/22[#22]
|Fix
|Broken passphrase feature for API Gateway 7.6.2 is fixed.

|https://github.com/Axway-API-Management-Plus/apigw-maven-plugin/issues/23[#23]
|Enhancement
|Support for multiple property files.

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.

.pom.xml
[source,xml]
----
<plugin>
<groupId>com.axway.maven.plugins</groupId>
<artifactId>apigw-maven-plugin</artifactId>
<version>${axway.maven.plugin.ver}</version>
<extensions>true</extensions>
<configuration>
<configPropertyFiles> <!--1-->
<configPropertyFile>${basedir}/a.json</configPropertyFile>
<configPropertyFile>${basedir}/b.json</configPropertyFile>
</configPropertyFiles>
</configuration>
</plugin>
----
<1> Configure multiple property files.

.command line
....
$ mvn package -Daxway.config.props.files=c.json,d.json
....

The files are used in the following order:

1. File specified by `axway.config.props` property.
1. Files specified in the <configuration> element.
1. Files specified by `axway.config.props.files` property.

If a property exists in the multiple property files the value of from the last property file is used.

|https://github.com/Axway-API-Management-Plus/apigw-maven-plugin/issues/24[#24]
|Enhancement
|Use Python logging for `buildfed`` tool.

|===

== Version 0.8.1
[cols="1,2,<10a", options="header"]
|===
Expand Down
2 changes: 1 addition & 1 deletion doc/getting-started/getting-started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:sectnums:
:source-highlighter: prettify

:mvn-plugin-ver: 0.8.1
:mvn-plugin-ver: 0.9.0

Here you get a simple introduction on how to use the _Maven Plugin for Axway API Gateway_.
It assumes that you are familiar with https://maven.apache.org[Apache Maven] and that you are familiar with PolicyStudio and the API Gateway.
Expand Down
37 changes: 7 additions & 30 deletions doc/manual/_config-tool.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Options:
Path of policy archive (.pol)
-c FILEPATH, --config=FILEPATH
Path of JSON configuration file
--prop=FILEPATH Path of JSON property file [optional]
--prop=FILEPATH Path of JSON property file [multiple]
--cert=FILEPATH Path of JSON certificate configuration file [optional]
--cert-expiration=DAYS
Check if certificates expire within the next days
Expand Down Expand Up @@ -78,7 +78,10 @@ The option is mandatory.
The option is mandatory.

|--prop
|An optional JSON file containing the property configuration.
|Path to a JSON file containing the property configuration.
Multiple files are supported by specifying the parameter multiple times.

If a property occurs in multiple files the value from the last file is used.

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

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

* Environmentalized fields: Mandatory configuration file for environmentalized fields.
* Certificates: Optional configuration file for certificates.
* Properties: Optional configuration file for properties.

The location of the mandatory configuration file for environmentalized fields is implicitly set to `${basedir}/src/main/axwgw/gateway.config.json`.

The file will be created during the initialization of the project (goal `apigw:init`).

The location of the other configuration files can be specified in the `<configuration>` element of the plugin (see below).

.pom.xml
[source,xml,subs="verbatim,attributes"]
----
<!- ... ->
<plugin>
<groupId>com.axway.maven.plugins</groupId>
<artifactId>apigw-maven-plugin</artifactId>
<version>{mvn-plugin-ver}</version>
<extensions>true</extensions>
<configuration>
<certsFile>${basedir}/src/main/axwgw/gateway.certs.json</certsFile> <!--1-->
<propertyFile>${basedir}/gateway.prop.json</propertyFile> <!--2-->
</configuration>
</plugin>
<!- ... ->
----
<1> Optional location of the configuration file for certificates.
<2> Optional location of the configuration file for properties.

NOTE: The configuration of the config files is only applicable for deployment projects.
* Properties: Optional configuration files for properties.

=== Environmentalized Fields

Expand Down
38 changes: 38 additions & 0 deletions doc/manual/_reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ Default: _none_

Default: _none_

|axway.config.props.files
|Comma separated path to configuration files for properties.

Default: _none_

|axway.tools.cfg.verbose
|Set to _true_ to enable verbose mode for internal configuration tool.

Expand Down Expand Up @@ -309,3 +314,36 @@ Default: false

NOTE: It is not checked if the source files are newer than the target artifact.
|===

== Plugin Configuration

The plugin can also be configured in the `pom.xml` via the <configuration> element of the plugin.

.pom.xml
[source,xml,subs="verbatim,attributes"]
----
<!- ... ->
<plugin>
<groupId>com.axway.maven.plugins</groupId>
<artifactId>apigw-maven-plugin</artifactId>
<version>{mvn-plugin-ver}</version>
<extensions>true</extensions>
<configuration>
<configConfigFile>${basedir}/src/main/axwgw/gateway.config.json</configConfigFile> <!--1-->
<configCertsFile>${basedir}/src/main/axwgw/gateway.certs.json</configCertsFile> <!--2-->
<configPropertyFile>${basedir}/gateway.prop.json</configPropertyFile> <!--3-->
<configPropertyFiles> <!--4-->
<configPropertyFile>${basedir}/prop-a.json</configPropertyFile>
<configPropertyFile>${basedir}/prop-b.json</configPropertyFile>
</configPropertFiles>
</configuration>
</plugin>
<!- ... ->
----
<1> Location of the configuration file for environmentalized fields.
<2> Location of the configuration file for certificates.
<3> Location of a configuration file for properties.
<4> Location of a list of configuration files for properties.
102 changes: 102 additions & 0 deletions doc/manual/_usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ For deployment following properties are used:
|`axway.config.props`
|Path to properties configuration file.
|no

|`axway.config.props.files`
|Comma separated list of paths to properties configuration files.
|no
|===

Example:
Expand Down Expand Up @@ -268,6 +272,104 @@ Steps:
. Execute `package` lifecycle.
. Deploy `.fed` package to gateway

== Configuration Files

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.

=== Environmentalized Fields

.pom.xml
[source,xml,subs="verbatim,attributes"]
----
<!- ... ->
<plugin>
<groupId>com.axway.maven.plugins</groupId>
<artifactId>apigw-maven-plugin</artifactId>
<version>{mvn-plugin-ver}</version>
<extensions>true</extensions>
<configuration>
<configConfigFile>${basedir}/src/main/axwgw/gateway.config.json</configConfigFile> <!--1-->
</configuration>
</plugin>
<!- ... ->
----
<1> Location of the configuration file for environmentalized fields.

.Command Line
....
$ mvn package -Daxway.config.envs=gateway.config.json
....

=== Certificates

.pom.xml
[source,xml,subs="verbatim,attributes"]
----
<!- ... ->
<plugin>
<groupId>com.axway.maven.plugins</groupId>
<artifactId>apigw-maven-plugin</artifactId>
<version>{mvn-plugin-ver}</version>
<extensions>true</extensions>
<configuration>
<configCertsFile>${basedir}/src/main/axwgw/gateway.certs.json</configCertsFile> <!--1-->
</configuration>
</plugin>
<!- ... ->
----
<1> Location of the configuration file for certificates.

.Command Line
....
$ mvn package -Daxway.config.certs=gateway.certs.json
....

=== Configure Properties

The Maven plugin supports three options to specify configuration properties:

1. Embedded in the configuration files for environmentalized fields or for certificates.
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.
1. Via configuration files specified by the <configPropertyFiles> element in the <configuration> element of the plugin.
1. Via configuration files specified by a comma separated list of the property `axway.config.props.files`. These are called the _additionally_ configuration files.

Properties are read in the order listed above.
If a property exists in multiple configuration files the value of the latest configuration file is used.

For deployment projects, the location of the mandatory configuration file for environmentalized fields is implicitly set to `${basedir}/src/main/axwgw/gateway.config.json`.
The file will be created during the initialization of the project (goal `apigw:init`).

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.

Examples:

.pom.xml
[source,xml,subs="verbatim,attributes"]
----
<!- ... ->
<plugin>
<groupId>com.axway.maven.plugins</groupId>
<artifactId>apigw-maven-plugin</artifactId>
<version>{mvn-plugin-ver}</version>
<extensions>true</extensions>
<configuration>
<configPropertyFile>${basedir}/gateway.prop.json</configPropertyFile> <!--1-->
<configPropertyFiles> <!--2-->
<configPropertyFile>${basedir}/prop-a.json</configPropertyFile>
<configPropertyFile>${basedir}/prop-b.json</configPropertyFile>
</configPropertFiles>
</configuration>
</plugin>
<!- ... ->
----
<1> Location of a configuration file for properties.
<2> Location of a list of configuration files for properties.

.Command Line
....
$ mvn package -Daxway.config.props=a.json -Daxway.config.props.files=b.json,c.json
....


== Miscellaneous

Expand Down
2 changes: 1 addition & 1 deletion doc/manual/user-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ifdef::env-github[]
:warning-caption: :warning:
endif::[]

:mvn-plugin-ver: 0.8.1
:mvn-plugin-ver: 0.9.0

== About the Plugin

Expand Down
3 changes: 2 additions & 1 deletion example/config-tool/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ In this example the `buildfed` tool will be invoked with the following parameter
* `-p src\gateway.pol`: specifies the path to the input `.pol` archive
* `-c config\gateway.config.json`: specifies the path to the environmentalized fields configuration file
* `--cert=config/gateway.certs.json`: specifies the path to the certificates configuration file
* `--prop=config/gateway.props.json`: specifies the path to the properties file
* `--prop=config/gateway.props.json`: specifies the path to a properties file
* `--prop=config/passwords.props.json`: specifies the path to a second properties file
* `--output-fed=gateway.fed`: specifies the path for the configured `.fed` archive
* `--passphrase-in=changeme`: passphrase for input archives (`.pol` and `.env`)
* `--passphrase-out=changed`: passphrase for the generated `.fed` file
Expand Down
16 changes: 8 additions & 8 deletions example/config-tool/config/gateway.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"fields": {
"attributeValue#0": {
"property": "artifact",
"property": "artifact",
"type": "string",
"used": true,
"value": null
Expand All @@ -21,21 +21,21 @@
"value": null
}
}
},
},
"/[NetService]name=Service/[HTTP]name=Default Service/[SSLInterface]name=HTTPS": {
"description": "",
"fields": {
"address#0": {
"property": null,
"type": "string",
"used": true,
"value": "localhost"
"property": "service.address",
"type": "string",
"used": true,
"value": null
},
"port#0": {
"property": null,
"property": "service.port",
"type": "string",
"used": true,
"value": "18443"
"value": null
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion example/config-tool/config/gateway.props.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"properties": {
"cert.password.staged.server": "changeme"
"service.address": "localhost",
"service.port": "18443"
}
}
5 changes: 5 additions & 0 deletions example/config-tool/config/passwords.props.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"properties": {
"cert.password.staged.server": "changeme"
}
}
Binary file added example/config-tool/gateway.fed
Binary file not shown.
2 changes: 1 addition & 1 deletion example/config-tool/run.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ SET CMD_HOME=%~dp0
CD /d "%CMD_HOME%"
SET BUILDFED="..\..\src\main\resources\scripts\buildfed.cmd"

CALL %BUILDFED% -e src\gateway.env -p src\gateway.pol -c config\gateway.config.json --cert=config/gateway.certs.json --prop=config/gateway.props.json --output-fed=gateway.fed --passphrase-in=changeme --passphrase-out=changed -D artifact:demo-1.0.0
CALL %BUILDFED% -e src\gateway.env -p src\gateway.pol -c config\gateway.config.json --cert=config\gateway.certs.json --prop=config\gateway.props.json --prop=config\passwords.props.json -D artifact:demo-1.0.0 --output-fed=gateway.fed --passphrase-in=changeme --passphrase-out=changed
ENDLOCAL
2 changes: 1 addition & 1 deletion example/getting-started/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<packaging>pom</packaging>

<properties>
<axway.maven.plugin.ver>0.8.1</axway.maven.plugin.ver>
<axway.maven.plugin.ver>0.9.0</axway.maven.plugin.ver>
</properties>

<modules>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<groupId>com.axway.maven.plugins</groupId>
<artifactId>apigw-maven-plugin</artifactId>
<version>0.8.1</version>
<version>0.9.0</version>
<packaging>maven-plugin</packaging>

<name>Axway API Gateway Maven Plugin</name>
Expand Down
Loading

0 comments on commit d40443a

Please sign in to comment.