@Override public void mirrorStandalone( RepositoryReferences sources, DestinationRepositoryDescriptor destination, Collection<IUDescription> seedIUs, MirrorOptions mirrorOptions, BuildOutputDirectory tempDirectory) throws FacadeException { IProvisioningAgent agent = Activator.createProvisioningAgent(tempDirectory); try { final MirrorApplication mirrorApp = createMirrorApplication(sources, destination, agent, mirrorOptions.isIncludePacked()); mirrorApp.setSlicingOptions(createSlicingOptions(mirrorOptions)); try { // we want to see mirror progress as this is a possibly long-running operation mirrorApp.setVerbose(true); mirrorApp.setLog(new LogListener(mavenContext.getLogger())); mirrorApp.setSourceIUs( querySourceIus(seedIUs, mirrorApp.getCompositeMetadataRepository(), sources)); IStatus returnStatus = mirrorApp.run(null); checkStatus(returnStatus); } catch (ProvisionException e) { throw new FacadeException( MIRROR_FAILURE_MESSAGE + ": " + StatusTool.collectProblems(e.getStatus()), e); } } finally { agent.stop(); } }
private static SlicingOptions createSlicingOptions(MirrorOptions mirrorOptions) { SlicingOptions slicingOptions = new SlicingOptions(); slicingOptions.considerStrictDependencyOnly(mirrorOptions.isFollowStrictOnly()); slicingOptions.everythingGreedy(mirrorOptions.isIncludeNonGreedy()); slicingOptions.followOnlyFilteredRequirements(mirrorOptions.isFollowOnlyFilteredRequirements()); slicingOptions.includeOptionalDependencies(mirrorOptions.isIncludeOptional()); slicingOptions.latestVersionOnly(mirrorOptions.isLatestVersionOnly()); slicingOptions.setFilter(mirrorOptions.getFilter()); return slicingOptions; }