Search in sources :

Example 1 with StandardMavenPluginImplications

use of org.commonjava.maven.galley.maven.internal.defaults.StandardMavenPluginImplications in project indy by Commonjava.

the class GalleyProvider method setup.

@PostConstruct
public void setup() {
    pluginDefaults = new StandardMaven304PluginDefaults();
    pluginImplications = new StandardMavenPluginImplications(xml);
}
Also used : StandardMaven304PluginDefaults(org.commonjava.maven.galley.maven.internal.defaults.StandardMaven304PluginDefaults) StandardMavenPluginImplications(org.commonjava.maven.galley.maven.internal.defaults.StandardMavenPluginImplications) PostConstruct(javax.annotation.PostConstruct)

Example 2 with StandardMavenPluginImplications

use of org.commonjava.maven.galley.maven.internal.defaults.StandardMavenPluginImplications in project galley by Commonjava.

the class AbstractMavenViewTest method loadPoms.

protected MavenPomView loadPoms(final String[] activeProfileIds, final String... pomNames) throws Exception {
    final List<DocRef<ProjectVersionRef>> stack = new ArrayList<DocRef<ProjectVersionRef>>();
    ProjectVersionRef pvr = null;
    for (final String pomName : pomNames) {
        final InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(getBaseResource() + pomName);
        final Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(is);
        final ProjectVersionRef ref = xml.getProjectVersionRef(document);
        if (pvr == null) {
            pvr = ref;
        }
        final DocRef<ProjectVersionRef> dr = new DocRef<ProjectVersionRef>(ref, new SimpleLocation("http://localhost:8080/"), document);
        stack.add(dr);
    }
    return new MavenPomView(pvr, stack, xpath, new StandardMaven304PluginDefaults(), new StandardMavenPluginImplications(xml), xml, activeProfileIds);
}
Also used : StandardMaven304PluginDefaults(org.commonjava.maven.galley.maven.internal.defaults.StandardMaven304PluginDefaults) ProjectVersionRef(org.commonjava.maven.atlas.ident.ref.ProjectVersionRef) InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) SimpleLocation(org.commonjava.maven.galley.model.SimpleLocation) Document(org.w3c.dom.Document) StandardMavenPluginImplications(org.commonjava.maven.galley.maven.internal.defaults.StandardMavenPluginImplications)

Example 3 with StandardMavenPluginImplications

use of org.commonjava.maven.galley.maven.internal.defaults.StandardMavenPluginImplications in project galley by Commonjava.

the class EmbeddableCDIProducer method postConstruct.

@PostConstruct
public void postConstruct() {
    fileEventManager = new NoOpFileEventManager();
    transferDecorator = new NoOpTransferDecorator();
    pathGenerator = new HashedLocationPathGenerator();
    nfc = new MemoryNotFoundCache();
    //        locationExpander = new NoOpLocationExpander();
    //        locationResolver = new SimpleUrlLocationResolver( locationExpander, transportManager );
    transportManagerConfig = new TransportManagerConfig();
    passwordManager = new MemoryPasswordManager();
    http = new HttpImpl(passwordManager);
    objectMapper = new ObjectMapper();
    objectMapper.registerModules(new ProjectVersionRefSerializerModule());
    pluginDefaults = new StandardMaven304PluginDefaults();
    pluginImplications = new StandardMavenPluginImplications(xml);
}
Also used : NoOpFileEventManager(org.commonjava.maven.galley.event.NoOpFileEventManager) StandardMaven304PluginDefaults(org.commonjava.maven.galley.maven.internal.defaults.StandardMaven304PluginDefaults) NoOpTransferDecorator(org.commonjava.maven.galley.io.NoOpTransferDecorator) HashedLocationPathGenerator(org.commonjava.maven.galley.io.HashedLocationPathGenerator) TransportManagerConfig(org.commonjava.maven.galley.config.TransportManagerConfig) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) MemoryPasswordManager(org.commonjava.maven.galley.auth.MemoryPasswordManager) StandardMavenPluginImplications(org.commonjava.maven.galley.maven.internal.defaults.StandardMavenPluginImplications) HttpImpl(org.commonjava.maven.galley.transport.htcli.HttpImpl) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) ProjectVersionRefSerializerModule(org.commonjava.maven.atlas.ident.jackson.ProjectVersionRefSerializerModule) PostConstruct(javax.annotation.PostConstruct)

Example 4 with StandardMavenPluginImplications

use of org.commonjava.maven.galley.maven.internal.defaults.StandardMavenPluginImplications 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

StandardMaven304PluginDefaults (org.commonjava.maven.galley.maven.internal.defaults.StandardMaven304PluginDefaults)4 StandardMavenPluginImplications (org.commonjava.maven.galley.maven.internal.defaults.StandardMavenPluginImplications)4 PostConstruct (javax.annotation.PostConstruct)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 ProjectVersionRefSerializerModule (org.commonjava.maven.atlas.ident.jackson.ProjectVersionRefSerializerModule)1 ProjectVersionRef (org.commonjava.maven.atlas.ident.ref.ProjectVersionRef)1 MemoryPasswordManager (org.commonjava.maven.galley.auth.MemoryPasswordManager)1 TransportManagerConfig (org.commonjava.maven.galley.config.TransportManagerConfig)1 NoOpFileEventManager (org.commonjava.maven.galley.event.NoOpFileEventManager)1 HashedLocationPathGenerator (org.commonjava.maven.galley.io.HashedLocationPathGenerator)1 NoOpTransferDecorator (org.commonjava.maven.galley.io.NoOpTransferDecorator)1 ArtifactManagerImpl (org.commonjava.maven.galley.maven.internal.ArtifactManagerImpl)1 ArtifactMetadataManagerImpl (org.commonjava.maven.galley.maven.internal.ArtifactMetadataManagerImpl)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