From 2e3c64fa92119622f9ee14b933b259588132372f Mon Sep 17 00:00:00 2001 From: manusa Date: Tue, 26 May 2020 07:47:29 +0200 Subject: [PATCH] fix: pom.xml configured runtime mode `` is considered instead of `` Signed-off-by: Marc Nuri --- CHANGELOG.md | 1 + .../plugin/mojo/build/OpenshiftBuildMojo.java | 16 +++++++++++++++- quickstarts/maven/spring-boot/pom.xml | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d32ae16db..ca97a2a6fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ Usage: * Fix #206: WebAppGenerator with "/" path renames artifacts to ROOT.war * Fix #206: WebAppGenerator>TomcatAppSeverHandler uses quay.io/jkube/jkube-tomcat9-binary-s2i as base image * Fix #210: WebAppGenerator>JettyAppSeverHandler uses quay.io/jkube/jkube-jetty9-binary-s2i as base image +* Fix : pom.xml configured runtime mode `` is considered instead of `` ### 1.0.0-alpha-3 (2020-05-06) * Fix #167: Add CMD for wildfly based applications diff --git a/openshift-maven-plugin/plugin/src/main/java/org/eclipse/jkube/maven/plugin/mojo/build/OpenshiftBuildMojo.java b/openshift-maven-plugin/plugin/src/main/java/org/eclipse/jkube/maven/plugin/mojo/build/OpenshiftBuildMojo.java index 2d5e92a54c..bea7af458a 100644 --- a/openshift-maven-plugin/plugin/src/main/java/org/eclipse/jkube/maven/plugin/mojo/build/OpenshiftBuildMojo.java +++ b/openshift-maven-plugin/plugin/src/main/java/org/eclipse/jkube/maven/plugin/mojo/build/OpenshiftBuildMojo.java @@ -41,7 +41,7 @@ public class OpenshiftBuildMojo extends BuildMojo { * Whether to perform a Kubernetes build (i.e. against a vanilla Docker daemon) or * an OpenShift build (with a Docker build against the OpenShift API server. */ - @Parameter(property = "jkube.mode") + @Parameter(name="mode", property = "jkube.mode") protected RuntimeMode configuredRuntimeMode = RuntimeMode.DEFAULT; /** @@ -109,4 +109,18 @@ protected GeneratorContext.GeneratorContextBuilder generatorContextBuilder() thr protected String getLogPrefix() { return OpenShift.DEFAULT_LOG_PREFIX; } + + /** + * Sets the configured {@link RuntimeMode} to be considered when resolving the effective runtime mode. + * + *

n.b this is a workaround for {@code @Parameter(name="mode")} being ignored + * + * @see MPLUGINTESTING-56 + * @see maven-annotation-api-parameter-name-method-seems-to-not-work + * + * @param mode configured RuntimeMode + */ + public void setMode(RuntimeMode mode) { + configuredRuntimeMode = mode; + } } diff --git a/quickstarts/maven/spring-boot/pom.xml b/quickstarts/maven/spring-boot/pom.xml index b9f8bbe619..95edb999f4 100644 --- a/quickstarts/maven/spring-boot/pom.xml +++ b/quickstarts/maven/spring-boot/pom.xml @@ -142,7 +142,7 @@ ${project.version} - + kubernetes