Code review comment: So I see why we support the capability to point to another jar but I don't see why we need to support this case? Could you explain it to me?  Thanks!

Code under review:
public void execute() throws MojoExecutionException, MojoFailureException {

        if (project.getPackaging().equals("pom") && appArtifact == null) {
            getLog().info("Type of the artifact is POM and appArtifact parameter has not been set, skipping native-image goal");
            return;
        }

        final AppCreator.Builder creatorBuilder = AppCreator.builder();
        CurateOutcome curateOutcome = null;
        AugmentOutcome augmentOutcome = null;
        RunnerJarOutcome runnerJarOutcome = null;

        if (!buildDir.isDirectory() || !new File(buildDir, "lib").isDirectory()) {
            

            final AppArtifact appCoords;
            DefaultArtifact appMvnArtifact = null;
            if (appArtifact == null) {
                appMvnArtifact = new DefaultArtifact(project.getArtifact().getGroupId(),
                        project.getArtifact().getArtifactId(),
                        project.getArtifact().getClassifier(),
                        project.getArtifact().getArtifactHandler().getExtension(),
                        project.getArtifact().getVersion());
                appCoords = new AppArtifact(appMvnArtifact.getGroupId(), appMvnArtifact.getArtifactId(),
                        appMvnArtifact.getClassifier(), appMvnArtifact.getExtension(),
                        appMvnArtifact.getVersion());
            } else {
                final String[] coordsArr = appArtifact.split(":");
                if (coordsArr.length < 2 || coordsArr.length > 5) {
                    throw new MojoExecutionException(
                            "appArtifact expression " + appArtifact
                                    + " does not follow format groupId:artifactId:classifier:type:version");
                }
                final String groupId = coordsArr[0];
                final String artifactId = coordsArr[1];
                String classifier = "";
                String type = "jar";
                String version = null;
                if (coordsArr.length == 3) {
                    version = coordsArr[2];
                } else if (coordsArr.length > 3) {
                    classifier = coordsArr[2] == null ? "" : coordsArr[2];
                    type = coordsArr[3] == null ? "jar" : coordsArr[3];
                    if (coordsArr.length > 4) {
                        version = coordsArr[4];
                    }
                }
                if (version == null) {
                    for (Artifact dep : project.getArtifacts()) {
                        if (dep.getArtifactId().equals(artifactId)
                                && dep.getGroupId().equals(groupId)
                                && dep.getClassifier().equals(classifier)
                                && dep.getType().equals(type)) {
                            appMvnArtifact = new DefaultArtifact(dep.getGroupId(),
                                    dep.getArtifactId(),
                                    dep.getClassifier(),
                                    dep.getArtifactHandler().getExtension(),
                                    dep.getVersion());
                            break;
                        }
                    }
                    if (appMvnArtifact == null) {
                        throw new MojoExecutionException(
                                "Failed to locate " + appArtifact + " among the project dependencies");
                    }
                    appCoords = new AppArtifact(appMvnArtifact.getGroupId(), appMvnArtifact.getArtifactId(),
                            appMvnArtifact.getClassifier(), appMvnArtifact.getExtension(),
                            appMvnArtifact.getVersion());
                } else {
                    appCoords = new AppArtifact(groupId, artifactId, classifier, type, version);
                    appMvnArtifact = new DefaultArtifact(groupId, artifactId, classifier, type, version);
                }
            }

            final AppModel appModel;
            final BootstrapAppModelResolver modelResolver;
            try {
                final MavenArtifactResolver mvn = MavenArtifactResolver.builder()
                        .setRepositorySystem(repoSystem)
                        .setRepositorySystemSession(repoSession)
                        .setRemoteRepositories(repos)
                        .build();
                appCoords.setPath(mvn.resolve(appMvnArtifact).getArtifact().getFile().toPath());
                modelResolver = new BootstrapAppModelResolver(mvn);
                appModel = modelResolver.resolveModel(appCoords);
            } catch (AppModelResolverException e) {
                throw new MojoExecutionException("Failed to resolve application model dependencies for " + appCoords, e);
            }

            final File appClasses = new File(outputDirectory, "app-classes");
            if (!appClasses.exists()) {
                appClasses.mkdirs();
            }
            try {
                ZipUtils.unzip(appModel.getAppArtifact().getPath(), appClasses.toPath());
            } catch (IOException e) {
                throw new MojoExecutionException("Failed to unzip " + appModel.getAppArtifact().getPath(), e);
            }

            creatorBuilder.addPhase(new AugmentPhase()
                    .setAppClassesDir(appClasses.toPath())
                    .setConfigDir(appClasses.toPath())
                    .setWiringClassesDir(wiringClassesDirectory.toPath()))
                    .addPhase(new RunnerJarPhase()
                            .setFinalName(finalName))
                    .setWorkDir(buildDir.toPath());

            curateOutcome = CurateOutcome.builder()
                    .setAppModelResolver(modelResolver)
                    .setAppModel(appModel)
                    .build();
        } else {
            
            augmentOutcome = new AugmentOutcome() {
                final Path classesDir = new File(outputDirectory, "classes").toPath();

                @Override
                public Path getAppClassesDir() {
                    return classesDir;
                }

                @Override
                public Path getTransformedClassesDir() {
                    
                    throw new UnsupportedOperationException();
                }

                @Override
                public Path getWiringClassesDir() {
                    
                    throw new UnsupportedOperationException();
                }

                @Override
                public Path getConfigDir() {
                    return classesDir;
                }

                @Override
                public Map<Path, Set<String>> getTransformedClassesByJar() {
                    return Collections.emptyMap();
                }
            };

            runnerJarOutcome = new RunnerJarOutcome() {
                final Path runnerJar = buildDir.toPath().resolve(finalName + "-runner.jar");
                final Path originalJar = buildDir.toPath().resolve(finalName + ".jar");

                @Override
                public Path getRunnerJar() {
                    return runnerJar;
                }

                @Override
                public Path getLibDir() {
                    return runnerJar.getParent().resolve("lib");
                }

                @Override
                public Path getOriginalJar() {
                    return originalJar;
                }
            };
        }

        creatorBuilder.addPhase(new NativeImagePhase()
                .setAddAllCharsets(addAllCharsets)
                .setAdditionalBuildArgs(additionalBuildArgs)
                .setAutoServiceLoaderRegistration(autoServiceLoaderRegistration)
                .setOutputDir(buildDir.toPath())
                .setCleanupServer(cleanupServer)
                .setDebugBuildProcess(debugBuildProcess)
                .setDebugSymbols(debugSymbols)
                .setDisableReports(disableReports)
                .setDockerBuild(dockerBuild)
                .setContainerRuntime(containerRuntime)
                .setContainerRuntimeOptions(containerRuntimeOptions)
                .setDumpProxies(dumpProxies)
                .setEnableAllSecurityServices(enableAllSecurityServices)
                .setEnableCodeSizeReporting(enableCodeSizeReporting)
                .setEnableFallbackImages(enableFallbackImages)
                .setEnableHttpsUrlHandler(enableHttpsUrlHandler)
                .setEnableHttpUrlHandler(enableHttpUrlHandler)
                .setEnableIsolates(enableIsolates)
                .setEnableJni(enableJni)
                .setEnableRetainedHeapReporting(enableRetainedHeapReporting)
                .setEnableServer(enableServer)
                .setEnableVMInspection(enableVMInspection)
                .setFullStackTraces(fullStackTraces)
                .setGraalvmHome(graalvmHome)
                .setNativeImageXmx(nativeImageXmx)
                .setReportErrorsAtRuntime(reportErrorsAtRuntime)
                .setReportExceptionStackTraces(reportExceptionStackTraces));

        try (AppCreator appCreator = creatorBuilder.build()) {
            if (curateOutcome != null) {
                appCreator.pushOutcome(CurateOutcome.class, curateOutcome);
            }
            if (augmentOutcome != null) {
                appCreator.pushOutcome(AugmentOutcome.class, augmentOutcome);
            }
            if (runnerJarOutcome != null) {
                appCreator.pushOutcome(RunnerJarOutcome.class, runnerJarOutcome);
            }
            appCreator.resolveOutcome(NativeImageOutcome.class);
        } catch (AppCreatorException e) {
            throw new MojoExecutionException("Failed to generate a native image", e);
        }
    }

Line commented on: appMvnArtifact.getVersion());

Revised code:
public void execute() throws MojoExecutionException, MojoFailureException {

        if (project.getPackaging().equals("pom") && appArtifact == null) {
            getLog().info("Type of the artifact is POM and appArtifact parameter has not been set, skipping native-image goal");
            return;
        }

        final AppCreator.Builder creatorBuilder = AppCreator.builder();
        CurateOutcome curateOutcome = null;
        AugmentOutcome augmentOutcome = null;
        RunnerJarOutcome runnerJarOutcome = null;

        if (!buildDir.isDirectory() || !new File(buildDir, "lib").isDirectory()) {
            

            final AppArtifact appCoords;
            DefaultArtifact appMvnArtifact = null;
            if (appArtifact == null) {
                appMvnArtifact = new DefaultArtifact(project.getArtifact().getGroupId(),
                        project.getArtifact().getArtifactId(),
                        project.getArtifact().getClassifier(),
                        project.getArtifact().getArtifactHandler().getExtension(),
                        project.getArtifact().getVersion());
                appCoords = new AppArtifact(appMvnArtifact.getGroupId(), appMvnArtifact.getArtifactId(),
                        appMvnArtifact.getClassifier(), appMvnArtifact.getExtension(),
                        appMvnArtifact.getVersion());
            } else {
                final String[] coordsArr = appArtifact.split(":");
                if (coordsArr.length < 2 || coordsArr.length > 5) {
                    throw new MojoExecutionException(
                            "appArtifact expression " + appArtifact
                                    + " does not follow format groupId:artifactId:classifier:type:version");
                }
                final String groupId = coordsArr[0];
                final String artifactId = coordsArr[1];
                String classifier = "";
                String type = "jar";
                String version = null;
                if (coordsArr.length == 3) {
                    version = coordsArr[2];
                } else if (coordsArr.length > 3) {
                    classifier = coordsArr[2] == null ? "" : coordsArr[2];
                    type = coordsArr[3] == null ? "jar" : coordsArr[3];
                    if (coordsArr.length > 4) {
                        version = coordsArr[4];
                    }
                }
                if (version == null) {
                    for (Artifact dep : project.getArtifacts()) {
                        if (dep.getArtifactId().equals(artifactId)
                                && dep.getGroupId().equals(groupId)
                                && dep.getClassifier().equals(classifier)
                                && dep.getType().equals(type)) {
                            appMvnArtifact = new DefaultArtifact(dep.getGroupId(),
                                    dep.getArtifactId(),
                                    dep.getClassifier(),
                                    dep.getArtifactHandler().getExtension(),
                                    dep.getVersion());
                            break;
                        }
                    }
                    if (appMvnArtifact == null) {
                        throw new MojoExecutionException(
                                "Failed to locate " + appArtifact + " among the project dependencies");
                    }
                    appCoords = new AppArtifact(appMvnArtifact.getGroupId(), appMvnArtifact.getArtifactId(),
                            appMvnArtifact.getClassifier(), appMvnArtifact.getExtension(),
                            appMvnArtifact.getVersion());
                } else {
                    appCoords = new AppArtifact(groupId, artifactId, classifier, type, version);
                    appMvnArtifact = new DefaultArtifact(groupId, artifactId, classifier, type, version);
                }
            }

            final AppModel appModel;
            final BootstrapAppModelResolver modelResolver;
            try {
                final MavenArtifactResolver mvn = MavenArtifactResolver.builder()
                        .setRepositorySystem(repoSystem)
                        .setRepositorySystemSession(repoSession)
                        .setRemoteRepositories(repos)
                        .build();
                appCoords.setPath(mvn.resolve(appMvnArtifact).getArtifact().getFile().toPath());
                modelResolver = new BootstrapAppModelResolver(mvn);
                appModel = modelResolver.resolveModel(appCoords);
            } catch (AppModelResolverException e) {
                throw new MojoExecutionException("Failed to resolve application model dependencies for " + appCoords, e);
            }

            final File appClasses = new File(outputDirectory, "app-classes");
            if (!appClasses.exists()) {
                appClasses.mkdirs();
            }
            try {
                ZipUtils.unzip(appModel.getAppArtifact().getPath(), appClasses.toPath());
            } catch (IOException e) {
                throw new MojoExecutionException("Failed to unzip " + appModel.getAppArtifact().getPath(), e);
            }

            creatorBuilder.addPhase(new AugmentPhase()
                    .setAppClassesDir(appClasses.toPath())
                    .setConfigDir(appClasses.toPath())
                    .setWiringClassesDir(wiringClassesDirectory.toPath()))
                    .addPhase(new RunnerJarPhase()
                            .setFinalName(finalName))
                    .setWorkDir(buildDir.toPath());

            curateOutcome = CurateOutcome.builder()
                    .setAppModelResolver(modelResolver)
                    .setAppModel(appModel)
                    .build();
        } else {
            
            augmentOutcome = new AugmentOutcome() {
                final Path classesDir = new File(outputDirectory, "classes").toPath();

                @Override
                public Path getAppClassesDir() {
                    return classesDir;
                }

                @Override
                public Path getTransformedClassesDir() {
                    
                    throw new UnsupportedOperationException();
                }

                @Override
                public Path getWiringClassesDir() {
                    
                    throw new UnsupportedOperationException();
                }

                @Override
                public Path getConfigDir() {
                    return classesDir;
                }

                @Override
                public Map<Path, Set<String>> getTransformedClassesByJar() {
                    return Collections.emptyMap();
                }
            };

            runnerJarOutcome = new RunnerJarOutcome() {
                final Path runnerJar = buildDir.toPath().resolve(finalName + "-runner.jar");
                final Path originalJar = buildDir.toPath().resolve(finalName + ".jar");

                @Override
                public Path getRunnerJar() {
                    return runnerJar;
                }

                @Override
                public Path getLibDir() {
                    return runnerJar.getParent().resolve("lib");
                }

                @Override
                public Path getOriginalJar() {
                    return originalJar;
                }
            };
        }

        creatorBuilder.addPhase(new NativeImagePhase()
                .setAddAllCharsets(addAllCharsets)
                .setAdditionalBuildArgs(additionalBuildArgs)
                .setAutoServiceLoaderRegistration(autoServiceLoaderRegistration)
                .setOutputDir(buildDir.toPath())
                .setCleanupServer(cleanupServer)
                .setDebugBuildProcess(debugBuildProcess)
                .setDebugSymbols(debugSymbols)
                .setDisableReports(disableReports)
                .setDockerBuild(dockerBuild)
                .setContainerRuntime(containerRuntime)
                .setContainerRuntimeOptions(containerRuntimeOptions)
                .setDumpProxies(dumpProxies)
                .setEnableAllSecurityServices(enableAllSecurityServices)
                .setEnableCodeSizeReporting(enableCodeSizeReporting)
                .setEnableFallbackImages(enableFallbackImages)
                .setEnableHttpsUrlHandler(enableHttpsUrlHandler)
                .setEnableHttpUrlHandler(enableHttpUrlHandler)
                .setEnableIsolates(enableIsolates)
                .setEnableJni(enableJni)
                .setEnableRetainedHeapReporting(enableRetainedHeapReporting)
                .setEnableServer(enableServer)
                .setEnableVMInspection(enableVMInspection)
                .setFullStackTraces(fullStackTraces)
                .setGraalvmHome(graalvmHome)
                .setNativeImageXmx(nativeImageXmx)
                .setReportErrorsAtRuntime(reportErrorsAtRuntime)
                .setReportExceptionStackTraces(reportExceptionStackTraces));

        try (AppCreator appCreator = creatorBuilder.build()) {
            if (curateOutcome != null) {
                appCreator.pushOutcome(CurateOutcome.class, curateOutcome);
            }
            if (augmentOutcome != null) {
                appCreator.pushOutcome(AugmentOutcome.class, augmentOutcome);
            }
            if (runnerJarOutcome != null) {
                appCreator.pushOutcome(RunnerJarOutcome.class, runnerJarOutcome);
            }
            appCreator.resolveOutcome(NativeImageOutcome.class);
        } catch (AppCreatorException e) {
            throw new MojoExecutionException("Failed to generate a native image", e);
        }
    }