Search in sources :

Example 1 with StandardTypeMapper

use of org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper in project indy by Commonjava.

the class MavenMetadataGeneratorTest method setup.

@Before
public void setup() throws Exception {
    stores = new MemoryStoreDataManager(true);
    final LocationExpander locations = new IndyLocationExpander(stores);
    final DownloadManager downloads = new DefaultDownloadManager(stores, fixture.getTransferManager(), locations);
    final XMLInfrastructure xml = new XMLInfrastructure();
    final TypeMapper types = new StandardTypeMapper();
    final MavenMetadataMerger merger = new MavenMetadataMerger(Collections.emptyList());
    final GroupMergeHelper helper = new GroupMergeHelper(downloads);
    DefaultDirectContentAccess contentAccess = new DefaultDirectContentAccess(downloads, Executors.newCachedThreadPool());
    generator = new MavenMetadataGenerator(contentAccess, stores, xml, types, merger, helper, new MemoryNotFoundCache());
    metadataReader = new MavenMetadataReader(xml, locations, fixture.getArtifactMetadataManager(), fixture.getXPathManager());
}
Also used : StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) TypeMapper(org.commonjava.maven.galley.maven.spi.type.TypeMapper) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) DownloadManager(org.commonjava.indy.content.DownloadManager) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) LocationExpander(org.commonjava.maven.galley.spi.transport.LocationExpander) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) MavenMetadataMerger(org.commonjava.indy.pkg.maven.content.group.MavenMetadataMerger) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) IndyLocationExpander(org.commonjava.indy.content.IndyLocationExpander) XMLInfrastructure(org.commonjava.maven.galley.maven.parse.XMLInfrastructure) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) MavenMetadataReader(org.commonjava.maven.galley.maven.parse.MavenMetadataReader) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) GroupMergeHelper(org.commonjava.indy.core.content.group.GroupMergeHelper) Before(org.junit.Before)

Example 2 with StandardTypeMapper

use of org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper in project indy by Commonjava.

the class TestProvider method init.

@PostConstruct
public void init() {
    try {
        this.storageProviderConfig = new DefaultStorageProviderConfiguration(TEMP.newFolder("storage"));
        this.dataConfig = new DataFileConfiguration(TEMP.newFolder("data"), TEMP.newFolder("work"));
    } catch (final IOException e) {
        e.printStackTrace();
        Assert.fail("Failed to setup temporary directory structures: " + e.getMessage());
    }
    this.nfc = new MemoryNotFoundCache();
    this.xmlInfra = new XMLInfrastructure();
    this.typeMapper = new StandardTypeMapper();
    this.indyConfig = new DefaultIndyConfiguration();
    this.objectMapper = new IndyObjectMapper(true);
}
Also used : DefaultStorageProviderConfiguration(org.commonjava.indy.filer.def.conf.DefaultStorageProviderConfiguration) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) DataFileConfiguration(org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration) XMLInfrastructure(org.commonjava.maven.galley.maven.parse.XMLInfrastructure) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) IOException(java.io.IOException) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration) PostConstruct(javax.annotation.PostConstruct)

Example 3 with StandardTypeMapper

use of org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper in project indy by Commonjava.

the class CoreServerProvider method init.

@PostConstruct
public void init() {
    try {
        folder.create();
        this.nfc = new MemoryNotFoundCache();
        this.dataFileManager = new DataFileManager(new DataFileConfiguration(folder.newFolder("indy-data")), dataFileEvents);
        this.storeManager = new DataFileStoreDataManager(dataFileManager, objectMapper, storeDispatch, new DefaultIndyConfiguration());
        storageConfig.setStorageRootDirectory(folder.newFolder("indy-storage"));
        this.xml = new XMLInfrastructure();
        this.typeMapper = new StandardTypeMapper();
    } catch (IOException e) {
        throw new IllegalStateException("Failed to start core server provider: " + e.getMessage(), e);
    } finally {
    }
}
Also used : DataFileStoreDataManager(org.commonjava.indy.flat.data.DataFileStoreDataManager) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) DataFileConfiguration(org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration) XMLInfrastructure(org.commonjava.maven.galley.maven.parse.XMLInfrastructure) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) IOException(java.io.IOException) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) PostConstruct(javax.annotation.PostConstruct)

Example 4 with StandardTypeMapper

use of org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper 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)

Example 5 with StandardTypeMapper

use of org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper in project galley by Commonjava.

the class ArtifactPathUtilsTest method handleRemoteSnapshotArtifactPath.

@Test
public void handleRemoteSnapshotArtifactPath() throws Exception {
    final ProjectVersionRef pvr = new SimpleProjectVersionRef("org.group", "artifact-id", "1.0-20140603.151226-11");
    final TypeMapper mapper = new StandardTypeMapper();
    final String path = ArtifactPathUtils.formatArtifactPath(pvr.asJarArtifact(), mapper);
    assertThat(path.equals("org/group/artifact-id/1.0-SNAPSHOT/artifact-id-" + pvr.getVersionString() + ".jar"), equalTo(true));
}
Also used : StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) TypeMapper(org.commonjava.maven.galley.maven.spi.type.TypeMapper) SimpleProjectVersionRef(org.commonjava.maven.atlas.ident.ref.SimpleProjectVersionRef) ProjectVersionRef(org.commonjava.maven.atlas.ident.ref.ProjectVersionRef) SimpleProjectVersionRef(org.commonjava.maven.atlas.ident.ref.SimpleProjectVersionRef) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) Test(org.junit.Test)

Aggregations

StandardTypeMapper (org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper)6 XMLInfrastructure (org.commonjava.maven.galley.maven.parse.XMLInfrastructure)4 MemoryNotFoundCache (org.commonjava.maven.galley.nfc.MemoryNotFoundCache)3 IOException (java.io.IOException)2 PostConstruct (javax.annotation.PostConstruct)2 DefaultIndyConfiguration (org.commonjava.indy.conf.DefaultIndyConfiguration)2 DownloadManager (org.commonjava.indy.content.DownloadManager)2 IndyLocationExpander (org.commonjava.indy.content.IndyLocationExpander)2 DefaultDirectContentAccess (org.commonjava.indy.core.content.DefaultDirectContentAccess)2 DefaultDownloadManager (org.commonjava.indy.core.content.DefaultDownloadManager)2 MemoryStoreDataManager (org.commonjava.indy.mem.data.MemoryStoreDataManager)2 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)2 DataFileConfiguration (org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration)2 MavenMetadataReader (org.commonjava.maven.galley.maven.parse.MavenMetadataReader)2 TypeMapper (org.commonjava.maven.galley.maven.spi.type.TypeMapper)2 KojiClient (com.redhat.red.build.koji.KojiClient)1 ChangeSummary (org.commonjava.indy.audit.ChangeSummary)1 ContentDigester (org.commonjava.indy.content.ContentDigester)1 DirectContentAccess (org.commonjava.indy.content.DirectContentAccess)1 DefaultContentDigester (org.commonjava.indy.core.content.DefaultContentDigester)1