Skip to content

Commit f2423a8

Browse files
committed
ID-46: certs base path is ignored by apigw:deploy
1 parent a1ad906 commit f2423a8

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

CHANGELOG.adoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44
[cols="1,2,<10a", options="header"]
55
|===
66
|ID|Type|Description
7-
|https://github.com/Axway-API-Management-Plus/apigw-maven-plugin/issues/40[#41]
7+
|https://github.com/Axway-API-Management-Plus/apigw-maven-plugin/issues/41[#41]
88
|Enhancement
99
|Improve error message in case of wrong certificate passphrase.
10+
11+
|https://github.com/Axway-API-Management-Plus/apigw-maven-plugin/issues/46[#46]
12+
|Bug
13+
|Base path for certificates is ignored by `apigw:deploy` goal (server or policy projects).
14+
15+
If the `apigw:deploy` goal is executed for server or policy projects, the configuration of the base path for certificates is ignored.
1016
|===
1117

1218
== Version 1.0.0

src/main/java/com/axway/maven/apigw/AbstractGatewayMojo.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ public abstract class AbstractGatewayMojo extends AbstractMojo {
104104
@Parameter(property = "axway.config.certs.basedir", required = false)
105105
protected File configCertsBaseDir = null;
106106

107+
@Parameter(property = "axway.tools.cfg.cert.expirationDays", required = false)
108+
protected int certExpirationDays = 10;
109+
110+
@Parameter(property = "axway.tools.cfg.cert.updateConfigured", required = false)
111+
protected boolean updateCertConfigFile = false;
112+
107113
@Parameter(property = "axway.config.secrets.file", required = false)
108114
protected File configSecretsFile = null;
109115

src/main/java/com/axway/maven/apigw/DeploymentArchiveMojo.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.apache.maven.plugin.MojoExecutionException;
1313
import org.apache.maven.plugins.annotations.LifecyclePhase;
1414
import org.apache.maven.plugins.annotations.Mojo;
15-
import org.apache.maven.plugins.annotations.Parameter;
1615
import org.apache.maven.plugins.annotations.ResolutionScope;
1716

1817
import com.axway.maven.apigw.utils.FedBuilder;
@@ -29,12 +28,6 @@ public class DeploymentArchiveMojo extends AbstractFlattendProjectArchiveMojo {
2928

3029
private Artifact serverArchive;
3130

32-
@Parameter(property = "axway.tools.cfg.cert.expirationDays", required = false)
33-
private int certExpirationDays = 10;
34-
35-
@Parameter(property = "axway.tools.cfg.cert.updateConfigured", required = false)
36-
private boolean updateCertConfigFile = false;
37-
3831
@Override
3932
protected String getArchiveExtension() {
4033
return PackageType.DEPLOYMENT.getExtension();
@@ -171,7 +164,7 @@ private void buildFedArchive(File targetDir, File srcPolFile, File srcEnvFile, F
171164
}
172165
if (this.configSecretsFile != null) {
173166
if (this.configSecretsKey == null)
174-
throw new MojoExecutionException("Passphrase for secrets file not specified!");
167+
throw new MojoExecutionException("Key file for secrets is not specified!");
175168
fedBuilder.setSecrets(this.configSecretsFile, this.configSecretsKey);
176169
}
177170

src/main/java/com/axway/maven/apigw/DeploymentMojo.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,14 @@ private File configFed(File pol, File env, File info) throws MojoExecutionExcept
130130

131131
fb.addPropertyFiles(getPropertyFiles());
132132

133-
fb.setCertificatesFile(this.configCertsFile);
134133
fb.enableVerboseMode(this.verboseCfgTools);
135134

135+
if (this.configCertsFile != null) {
136+
fb.setCertificatesFile(this.configCertsFile);
137+
fb.setCertificateExpirationDays(this.certExpirationDays);
138+
fb.enableCertificateConfigFileUpdate(this.updateCertConfigFile);
139+
fb.setCertificatesBasePath(this.configCertsBaseDir);
140+
}
136141
if (this.configSecretsFile != null) {
137142
if (this.configSecretsKey == null)
138143
throw new MojoExecutionException("Key file for secrets is not specified!");

0 commit comments

Comments
 (0)