Skip to content

Commit

Permalink
fix: pom.xml configured runtime mode <mode> is considered instead o…
Browse files Browse the repository at this point in the history
…f `<configuredRuntimeMode>`

Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa committed May 26, 2020
1 parent 8fc6f14 commit 2e3c64f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<mode>` is considered instead of `<configuredRuntimeMode>`

### 1.0.0-alpha-3 (2020-05-06)
* Fix #167: Add CMD for wildfly based applications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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.
*
* <p>n.b this is a workaround for <code>{@code @Parameter(name="mode")}</code> being ignored
*
* @see <a href="https://issues.apache.org/jira/browse/MPLUGINTESTING-56">MPLUGINTESTING-56</a>
* @see <a href="https://stackoverflow.com/questions/30913685/maven-annotation-api-parameter-name-method-seems-to-not-work">maven-annotation-api-parameter-name-method-seems-to-not-work</a>
*
* @param mode configured RuntimeMode
*/
public void setMode(RuntimeMode mode) {
configuredRuntimeMode = mode;
}
}
2 changes: 1 addition & 1 deletion quickstarts/maven/spring-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<version>${project.version}</version>

<configuration>

<mode>kubernetes</mode>
<resources>
<labels>
<all>
Expand Down

0 comments on commit 2e3c64f

Please sign in to comment.