diff --git a/kubernetes-maven-plugin/plugin/src/main/java/org/eclipse/jkube/maven/plugin/mojo/build/ResourceMojo.java b/kubernetes-maven-plugin/plugin/src/main/java/org/eclipse/jkube/maven/plugin/mojo/build/ResourceMojo.java index 5fab601cdf..1b1b50e71c 100644 --- a/kubernetes-maven-plugin/plugin/src/main/java/org/eclipse/jkube/maven/plugin/mojo/build/ResourceMojo.java +++ b/kubernetes-maven-plugin/plugin/src/main/java/org/eclipse/jkube/maven/plugin/mojo/build/ResourceMojo.java @@ -178,12 +178,12 @@ protected ResourceClassifier getResourceClassifier() { private void validateIfRequired(File resourceDir, ResourceClassifier classifier) throws MojoExecutionException, MojoFailureException { try { - if (!skipResourceValidation) { + if (Boolean.FALSE.equals(skipResourceValidation)) { log.verbose("Validating resources"); new ResourceValidator(resourceDir, classifier, log).validate(); } } catch (ConstraintViolationException e) { - if (failOnValidationError) { + if (Boolean.TRUE.equals(failOnValidationError)) { log.error("[[R]]" + e.getMessage() + "[[R]]"); log.error("[[R]]use \"mvn -Djkube.skipResourceValidation=true\" option to skip the validation[[R]]"); throw new MojoFailureException("Failed to generate kubernetes descriptor"); @@ -191,7 +191,7 @@ private void validateIfRequired(File resourceDir, ResourceClassifier classifier) log.warn("[[Y]]" + e.getMessage() + "[[Y]]"); } } catch (Exception e) { - if (failOnValidationError) { + if (Boolean.TRUE.equals(failOnValidationError)) { throw new MojoExecutionException("Failed to validate resources", e); } else { log.warn("Failed to validate resources: %s", e.getMessage()); diff --git a/kubernetes-maven-plugin/plugin/src/test/java/org/eclipse/jkube/maven/plugin/mojo/develop/RemoteDevMojoTest.java b/kubernetes-maven-plugin/plugin/src/test/java/org/eclipse/jkube/maven/plugin/mojo/develop/RemoteDevMojoTest.java index 0220019b27..efcc8ec6c0 100644 --- a/kubernetes-maven-plugin/plugin/src/test/java/org/eclipse/jkube/maven/plugin/mojo/develop/RemoteDevMojoTest.java +++ b/kubernetes-maven-plugin/plugin/src/test/java/org/eclipse/jkube/maven/plugin/mojo/develop/RemoteDevMojoTest.java @@ -84,6 +84,6 @@ void execute_withException_shouldStop() throws Exception { // Then assertThat(remoteDevelopmentService.constructed()) .singleElement() - .satisfies(remoteDevelopmentService -> verify(remoteDevelopmentService, times(1)).stop()); + .satisfies(service -> verify(service, times(1)).stop()); } } diff --git a/kubernetes-maven-plugin/plugin/src/test/java/org/eclipse/jkube/maven/plugin/mojo/develop/UndeployMojoTest.java b/kubernetes-maven-plugin/plugin/src/test/java/org/eclipse/jkube/maven/plugin/mojo/develop/UndeployMojoTest.java index 6dc76e6f0d..92faa13a68 100644 --- a/kubernetes-maven-plugin/plugin/src/test/java/org/eclipse/jkube/maven/plugin/mojo/develop/UndeployMojoTest.java +++ b/kubernetes-maven-plugin/plugin/src/test/java/org/eclipse/jkube/maven/plugin/mojo/develop/UndeployMojoTest.java @@ -71,7 +71,7 @@ void setUp() throws IOException { .log(new KitLogger.SilentLogger()) .platformMode(RuntimeMode.KUBERNETES) .build(); -// log = new KitLogger.SilentLogger(); + mojoExecution = new MojoExecution(new MojoDescriptor()); mojoExecution.getMojoDescriptor().setPluginDescriptor(new PluginDescriptor()); mojoExecution.getMojoDescriptor().getPluginDescriptor().setGoalPrefix("k8s");