class DefaultMavenVersionResolver implements MavenVersionResolver {

	private static final Log logger = LogFactory.getLog(DefaultMavenVersionResolver.class);

	private static final RemoteRepository mavenCentral = new RemoteRepository.Builder("central", "default",
			"https://repo1.maven.org/maven2")
		.build();

	private static final RemoteRepository springMilestones = new RemoteRepository.Builder("spring-milestones",
			"default", "https://repo.spring.io/milestone")
		.build();

	private static final RemoteRepository springSnapshots = new RemoteRepository.Builder("spring-snapshots", "default",
			"https://repo.spring.io/snapshot")
		.build();

	private static final List<RemoteRepository> repositories = Arrays.asList(mavenCentral, springMilestones,
			springSnapshots);

	private final Object monitor = new Object();

	private final RepositorySystemSession repositorySystemSession;

	private final RemoteRepositoryManager remoteRepositoryManager;

	private final RepositorySystem repositorySystem;

	DefaultMavenVersionResolver(Path cacheLocation) {
		ServiceLocator serviceLocator = createServiceLocator();
		DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
		session.setArtifactDescriptorPolicy(new SimpleArtifactDescriptorPolicy(false, false));
		LocalRepository localRepository = new LocalRepository(cacheLocation.toFile());
		this.repositorySystem = serviceLocator.getService(RepositorySystem.class);
		session.setLocalRepositoryManager(this.repositorySystem.newLocalRepositoryManager(session, localRepository));
		session.setUserProperties(System.getProperties());
		session.setReadOnly();
		this.repositorySystemSession = session;
		this.remoteRepositoryManager = serviceLocator.getService(RemoteRepositoryManager.class);
	}

	@Override
	public Map<String, String> resolveDependencies(String groupId, String artifactId, String version) {
		ArtifactDescriptorResult bom = resolveBom(groupId, artifactId, version);
		Map<String, String> managedVersions = new HashMap<>();
		bom.getManagedDependencies()
			.stream()
			.map(Dependency::getArtifact)
			.forEach((artifact) -> managedVersions.putIfAbsent(artifact.getGroupId() + ":" + artifact.getArtifactId(),
					artifact.getVersion()));
		return managedVersions;
	}

	@Override
	public Map<String, String> resolvePlugins(String groupId, String artifactId, String version) {
		Model model = buildEffectiveModel(groupId, artifactId, version);
		Map<String, String> managedPluginVersions = new HashMap<>();
		model.getBuild()
			.getPluginManagement()
			.getPlugins()
			.forEach((plugin) -> managedPluginVersions.putIfAbsent(plugin.getGroupId() + ":" + plugin.getArtifactId(),
					plugin.getVersion()));
		return managedPluginVersions;
	}

	private ArtifactDescriptorResult resolveBom(String groupId, String artifactId, String version) {<FILL_FUNCTION_BODY>}

	private Model buildEffectiveModel(String groupId, String artifactId, String version) {
		try {
			ArtifactResult bom = resolvePom(groupId, artifactId, version);
			RequestTrace requestTrace = new RequestTrace(null);

			ModelResolver modelResolver = new ProjectModelResolver(this.repositorySystemSession, requestTrace,
					this.repositorySystem, this.remoteRepositoryManager, repositories,
					ProjectBuildingRequest.RepositoryMerging.POM_DOMINANT, null);
			DefaultModelBuildingRequest modelBuildingRequest = new DefaultModelBuildingRequest();
			modelBuildingRequest.setSystemProperties(System.getProperties());
			modelBuildingRequest.setPomFile(bom.getArtifact().getFile());
			modelBuildingRequest.setModelResolver(modelResolver);
			DefaultModelBuilder modelBuilder = new DefaultModelBuilderFactory().newInstance();
			return modelBuilder.build(modelBuildingRequest).getEffectiveModel();
		}
		catch (ModelBuildingException ex) {
			Model model = ex.getModel();
			if (model != null) {
				logger.warn("Model for '" + groupId + ":" + artifactId + ":" + version + "' is incomplete: "
						+ ex.getProblems());
				return model;
			}
			throw new IllegalStateException(
					"Model for '" + groupId + ":" + artifactId + ":" + version + "' could not be built", ex);
		}
	}

	private ArtifactResult resolvePom(String groupId, String artifactId, String version) {
		synchronized (this.monitor) {
			try {
				return this.repositorySystem.resolveArtifact(this.repositorySystemSession, new ArtifactRequest(
						new DefaultArtifact(groupId, artifactId, "pom", version), repositories, null));
			}
			catch (ArtifactResolutionException ex) {
				throw new IllegalStateException(
						"Pom '" + groupId + ":" + artifactId + ":" + version + "' could not be resolved", ex);
			}
		}
	}

	private static ServiceLocator createServiceLocator() {
		DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
		locator.addService(RepositorySystem.class, DefaultRepositorySystem.class);
		locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
		locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
		return locator;
	}

}

		synchronized (this.monitor) {
			try {
				return this.repositorySystem.readArtifactDescriptor(this.repositorySystemSession,
						new ArtifactDescriptorRequest(new DefaultArtifact(groupId, artifactId, "pom", version),
								repositories, null));
			}
			catch (ArtifactDescriptorException ex) {
				throw new IllegalStateException(
						"Bom '" + groupId + ":" + artifactId + ":" + version + "' could not be resolved", ex);
			}
		}
	
<no_super_class>