Search in sources :

Example 1 with VersionResolverImpl

use of org.commonjava.maven.galley.maven.internal.version.VersionResolverImpl in project galley by Commonjava.

the class TestFixture method initMissingComponents.

@Override
public void initMissingComponents() throws Exception {
    super.initGalley();
    super.initMissingComponents();
    // setup version resolver.
    if (xml == null) {
        xml = new XMLInfrastructure();
    }
    if (xpath == null) {
        xpath = new XPathManager();
    }
    if (metadataManager == null) {
        metadataManager = new ArtifactMetadataManagerImpl(getTransferManager(), getLocationExpander());
    }
    if (metadataReader == null) {
        metadataReader = new MavenMetadataReader(xml, getLocationExpander(), metadataManager, xpath);
    }
    if (versionResolver == null) {
        versionResolver = new VersionResolverImpl(metadataReader);
    }
    if (typeMapper == null) {
        typeMapper = new StandardTypeMapper();
    }
    if (artifactManager == null) {
        Logger logger = LoggerFactory.getLogger(getClass());
        logger.debug("Initializing ArtifactManagerImpl using:\n  TransferManager: {}\n  LocationExpander: {}\n  TypeMapper: {}\n  VersionResolver: {}", getTransferManager(), getLocationExpander(), typeMapper, versionResolver);
        artifactManager = new ArtifactManagerImpl(getTransferManager(), getLocationExpander(), typeMapper, versionResolver);
    } else {
        Logger logger = LoggerFactory.getLogger(getClass());
        logger.debug("Using passed-in ArtifactManager instance: {}", artifactManager);
    }
    if (pluginDefaults == null) {
        pluginDefaults = new StandardMaven304PluginDefaults();
    }
    if (pluginImplications == null) {
        pluginImplications = new StandardMavenPluginImplications(xml);
    }
    if (modelProcessor == null) {
        modelProcessor = new MavenModelProcessor();
    }
    if (pomReader == null) {
        pomReader = new MavenPomReader(xml, getLocationExpander(), getArtifactManager(), getXpath(), getPluginDefaults(), getPluginImplications());
    }
}
Also used : StandardMaven304PluginDefaults(org.commonjava.maven.galley.maven.internal.defaults.StandardMaven304PluginDefaults) VersionResolverImpl(org.commonjava.maven.galley.maven.internal.version.VersionResolverImpl) XMLInfrastructure(org.commonjava.maven.galley.maven.parse.XMLInfrastructure) ArtifactManagerImpl(org.commonjava.maven.galley.maven.internal.ArtifactManagerImpl) XPathManager(org.commonjava.maven.galley.maven.model.view.XPathManager) MavenPomReader(org.commonjava.maven.galley.maven.parse.MavenPomReader) MavenMetadataReader(org.commonjava.maven.galley.maven.parse.MavenMetadataReader) Logger(org.slf4j.Logger) MavenModelProcessor(org.commonjava.maven.galley.maven.rel.MavenModelProcessor) StandardMavenPluginImplications(org.commonjava.maven.galley.maven.internal.defaults.StandardMavenPluginImplications) ArtifactMetadataManagerImpl(org.commonjava.maven.galley.maven.internal.ArtifactMetadataManagerImpl) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper)

Aggregations

ArtifactManagerImpl (org.commonjava.maven.galley.maven.internal.ArtifactManagerImpl)1 ArtifactMetadataManagerImpl (org.commonjava.maven.galley.maven.internal.ArtifactMetadataManagerImpl)1 StandardMaven304PluginDefaults (org.commonjava.maven.galley.maven.internal.defaults.StandardMaven304PluginDefaults)1 StandardMavenPluginImplications (org.commonjava.maven.galley.maven.internal.defaults.StandardMavenPluginImplications)1 StandardTypeMapper (org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper)1 VersionResolverImpl (org.commonjava.maven.galley.maven.internal.version.VersionResolverImpl)1 XPathManager (org.commonjava.maven.galley.maven.model.view.XPathManager)1 MavenMetadataReader (org.commonjava.maven.galley.maven.parse.MavenMetadataReader)1 MavenPomReader (org.commonjava.maven.galley.maven.parse.MavenPomReader)1 XMLInfrastructure (org.commonjava.maven.galley.maven.parse.XMLInfrastructure)1 MavenModelProcessor (org.commonjava.maven.galley.maven.rel.MavenModelProcessor)1 Logger (org.slf4j.Logger)1