From e2c97186ce1bddd3cf6180092f95743ab80d7826 Mon Sep 17 00:00:00 2001 From: Manfred Riem Date: Thu, 4 Apr 2024 16:43:45 -0500 Subject: [PATCH] Fixes #3698 - Expose --https-keystore-file parameter to Maven plugin --- .../java/cloud/piranha/maven/plugins/piranha/BaseMojo.java | 6 ++++++ .../java/cloud/piranha/maven/plugins/piranha/RunMojo.java | 4 ++++ .../java/cloud/piranha/maven/plugins/piranha/StartMojo.java | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/maven/plugins/piranha-maven-plugin/src/main/java/cloud/piranha/maven/plugins/piranha/BaseMojo.java b/maven/plugins/piranha-maven-plugin/src/main/java/cloud/piranha/maven/plugins/piranha/BaseMojo.java index 86c5ac10b5..40c45abc84 100644 --- a/maven/plugins/piranha-maven-plugin/src/main/java/cloud/piranha/maven/plugins/piranha/BaseMojo.java +++ b/maven/plugins/piranha-maven-plugin/src/main/java/cloud/piranha/maven/plugins/piranha/BaseMojo.java @@ -75,6 +75,12 @@ public abstract class BaseMojo extends AbstractMojo { @Parameter(defaultValue = "8080", property = "piranha.httpPort", required = false) protected Integer httpPort; + /** + * Stores the HTTPS keystore file. + */ + @Parameter(property = "piranha.httpsKeystoreFile", required = false) + protected String httpsKeystoreFile; + /** * Stores the HTTPS port */ diff --git a/maven/plugins/piranha-maven-plugin/src/main/java/cloud/piranha/maven/plugins/piranha/RunMojo.java b/maven/plugins/piranha-maven-plugin/src/main/java/cloud/piranha/maven/plugins/piranha/RunMojo.java index 5c96f5aab4..2bcc894626 100644 --- a/maven/plugins/piranha-maven-plugin/src/main/java/cloud/piranha/maven/plugins/piranha/RunMojo.java +++ b/maven/plugins/piranha-maven-plugin/src/main/java/cloud/piranha/maven/plugins/piranha/RunMojo.java @@ -85,6 +85,10 @@ private void startJarPiranha() throws IOException { commands.add("--https-port"); commands.add(httpsPort.toString()); } + if (httpsKeystoreFile != null) { + commands.add("--https-keystore-file"); + commands.add(httpsKeystoreFile); + } commands.add("--war-file"); commands.add(warName + ".war"); commands.add("--write-pid"); diff --git a/maven/plugins/piranha-maven-plugin/src/main/java/cloud/piranha/maven/plugins/piranha/StartMojo.java b/maven/plugins/piranha-maven-plugin/src/main/java/cloud/piranha/maven/plugins/piranha/StartMojo.java index 35c595052e..713cbaaf51 100644 --- a/maven/plugins/piranha-maven-plugin/src/main/java/cloud/piranha/maven/plugins/piranha/StartMojo.java +++ b/maven/plugins/piranha-maven-plugin/src/main/java/cloud/piranha/maven/plugins/piranha/StartMojo.java @@ -85,6 +85,10 @@ private void startJarPiranha() throws IOException { commands.add("--https-port"); commands.add(httpsPort.toString()); } + if (httpsKeystoreFile != null) { + commands.add("--https-keystore-file"); + commands.add(httpsKeystoreFile); + } commands.add("--war-file"); commands.add(warName + ".war"); commands.add("--write-pid");