Skip to content

Commit

Permalink
Merge pull request #14615 from ioforks/fix-14476-packaging-npe
Browse files Browse the repository at this point in the history
Fix NPE when packaging uber-jar on Openshift
  • Loading branch information
gsmet authored Jan 26, 2021
2 parents 91a82d2 + 0b5385e commit 28f2e85
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,12 @@ public void openshiftBuildFromJar(OpenshiftConfig openshiftConfig,
if (packageConfig.isFastJar()) {
createContainerImage(kubernetesClient, openshiftYml.get(), config, contextRoot, jar.getPath().getParent(),
jar.getPath().getParent());
} else {
} else if (jar.getLibraryDir() != null) { //When using uber-jar the libraryDir is going to be null, potentially causing NPE.
createContainerImage(kubernetesClient, openshiftYml.get(), config, contextRoot, jar.getPath().getParent(),
jar.getPath(), jar.getLibraryDir());
} else {
createContainerImage(kubernetesClient, openshiftYml.get(), config, contextRoot, jar.getPath().getParent(),
jar.getPath());
}
artifactResultProducer.produce(new ArtifactResultBuildItem(null, "jar-container", Collections.emptyMap()));
}
Expand Down

0 comments on commit 28f2e85

Please sign in to comment.