Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ public NativeImageMojo() {
@Override
public void execute() throws MojoExecutionException, MojoFailureException {

if (! buildDir.isDirectory() || ! new File(buildDir, "lib").isDirectory()) {
throw new MojoFailureException("Unable to find the required build output. " +
"Please ensure that the 'build' goal has been properly configured for the project - since it is a prerequisite of the 'native-image' goal");
}

try(AppCreator appCreator = AppCreator.builder()
// configure the build phase we want the app to go through
.addPhase(new NativeImagePhase()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ public void provideOutcome(AppCreator ctx) throws AppCreatorException {
final String runnerJarName = runnerJar.getFileName().toString();

Path outputLibDir = outputDir.resolve(runnerJarOutcome.getLibDir().getFileName());
boolean outputLibDirCopied = false;
if (Files.exists(outputLibDir)) {
outputLibDir = null;
} else {
Expand All @@ -245,6 +246,7 @@ public void provideOutcome(AppCreator ctx) throws AppCreatorException {
} catch (IOException e) {
throw new AppCreatorException("Failed to copy the runnable jar and the lib to the docker project dir", e);
}
outputLibDirCopied = true;
}

final Config config = SmallRyeConfigProviderResolver.instance().getConfig();
Expand Down Expand Up @@ -411,7 +413,7 @@ public void provideOutcome(AppCreator ctx) throws AppCreatorException {
if(runnerJarCopied) {
IoUtils.recursiveDelete(runnerJar);
}
if(outputLibDir != null) {
if(outputLibDirCopied) {
IoUtils.recursiveDelete(outputLibDir);
}
}
Expand Down