Skip to content

Commit

Permalink
Merge pull request #213 from jfdenise/master
Browse files Browse the repository at this point in the history
Fix for WFMP-142, Plugin should handle the case of not found deployment
  • Loading branch information
jamezp authored Jan 12, 2022
2 parents 489d983 + 58977dc commit 8ec5c00
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,11 @@ private Path getDeploymentContent() throws MojoExecutionException {
throw new MojoExecutionException("No deployment found wih name " + this.filename);
}
if (this.runtimeName != null ) {
throw new MojoExecutionException("No deployment found although a runtime-name has been set. "
+ "Check the final name of the deployment. A custom file name can be set with <filename> parameter.");
throw new MojoExecutionException("No deployment found with name " + filename +
". A runtime-name has been set that indicates that a deployment is expected. "
+ "A custom file name can be set with the <filename> parameter.");
}
getLog().warn("No deployment file found, the server will not contain a deployment");
getLog().warn("No deployment found. The file " + filename + " doesn't exist, the server will not contain any deployment");
}
return deployment;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public void testInvalidDeployment2() throws Exception {
throw new Exception("Execution should have failed");
} catch(MojoExecutionException ex) {
// XXX OK, expected.
Assert.assertTrue(ex.getLocalizedMessage().contains("No deployment found although a runtime-name has been set"));
Assert.assertTrue(ex.getLocalizedMessage().contains("No deployment found with name foo.jar. "
+ "A runtime-name has been set that indicates that a deployment is expected. "));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<version>0.1.0-SNAPSHOT</version>

<build>
<finalName>foo</finalName>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
Expand Down

0 comments on commit 8ec5c00

Please sign in to comment.