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());
}
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);
}
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 {
}
}
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());
}
}
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));
}
Aggregations