File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
cli/maven/src/main/java/org/jboss/shamrock/maven
core/creator/src/main/java/org/jboss/shamrock/creator/phase/nativeimage Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,11 @@ public NativeImageMojo() {
126
126
@ Override
127
127
public void execute () throws MojoExecutionException , MojoFailureException {
128
128
129
+ if (! buildDir .isDirectory () || ! new File (buildDir , "lib" ).isDirectory ()) {
130
+ throw new MojoFailureException ("Unable to find the required build output. " +
131
+ "Please ensure that the 'build' goal has been properly configured for the project - since it is a prerequisite of the 'native-image' goal" );
132
+ }
133
+
129
134
try (AppCreator appCreator = AppCreator .builder ()
130
135
// configure the build phase we want the app to go through
131
136
.addPhase (new NativeImagePhase ()
Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ public void provideOutcome(AppCreator ctx) throws AppCreatorException {
237
237
final String runnerJarName = runnerJar .getFileName ().toString ();
238
238
239
239
Path outputLibDir = outputDir .resolve (runnerJarOutcome .getLibDir ().getFileName ());
240
+ boolean outputLibDirCopied = false ;
240
241
if (Files .exists (outputLibDir )) {
241
242
outputLibDir = null ;
242
243
} else {
@@ -245,6 +246,7 @@ public void provideOutcome(AppCreator ctx) throws AppCreatorException {
245
246
} catch (IOException e ) {
246
247
throw new AppCreatorException ("Failed to copy the runnable jar and the lib to the docker project dir" , e );
247
248
}
249
+ outputLibDirCopied = true ;
248
250
}
249
251
250
252
final Config config = SmallRyeConfigProviderResolver .instance ().getConfig ();
@@ -411,7 +413,7 @@ public void provideOutcome(AppCreator ctx) throws AppCreatorException {
411
413
if (runnerJarCopied ) {
412
414
IoUtils .recursiveDelete (runnerJar );
413
415
}
414
- if (outputLibDir != null ) {
416
+ if (outputLibDirCopied ) {
415
417
IoUtils .recursiveDelete (outputLibDir );
416
418
}
417
419
}
You can’t perform that action at this time.
0 commit comments