private Set < Artifact > resolveExecutableDependencies ( Artifact executablePomArtifact ) throws MojoExecutionException { Set < Artifact > executableDependencies = new LinkedHashSet <> ( ) ; try { ProjectBuildingRequest buildingRequest = getSession ( ) . getProjectBuildingRequest ( ) ; MavenProject executableProject = this . projectBuilder . build ( executablePomArtifact , buildingRequest ) . getProject ( ) ; for ( ArtifactResult artifactResult : dependencyResolver . resolveDependencies ( buildingRequest , executableProject . getModel ( ) , null ) ) { executableDependencies . add ( artifactResult . getArtifact ( ) ) ; } } catch ( Exception ex ) { throw new MojoExecutionException ( "Encountered problems resolving dependencies of the executable " + "in preparation for its execution." , ex ) ; } return executableDependencies ; }
Resolve the executable dependencies for the specified project