Search in sources :

Example 1 with ArchetypeDataSource

use of org.apache.maven.archetype.source.ArchetypeDataSource in project intellij-community by JetBrains.

the class Maven3ServerIndexerImpl method doCollectArchetypes.

private void doCollectArchetypes(String roleHint, Set<MavenArchetype> result) throws RemoteException {
    try {
        ArchetypeDataSource source = myEmbedder.getComponent(ArchetypeDataSource.class, roleHint);
        ArchetypeCatalog archetypeCatalog = source.getArchetypeCatalog(new Properties());
        for (Archetype each : archetypeCatalog.getArchetypes()) {
            result.add(MavenModelConverter.convertArchetype(each));
        }
    } catch (ArchetypeDataSourceException e) {
        Maven3ServerGlobals.getLogger().warn(e);
    }
}
Also used : MavenArchetype(org.jetbrains.idea.maven.model.MavenArchetype) Archetype(org.apache.maven.archetype.catalog.Archetype) ArchetypeDataSourceException(org.apache.maven.archetype.source.ArchetypeDataSourceException) ArchetypeDataSource(org.apache.maven.archetype.source.ArchetypeDataSource) ArchetypeCatalog(org.apache.maven.archetype.catalog.ArchetypeCatalog)

Example 2 with ArchetypeDataSource

use of org.apache.maven.archetype.source.ArchetypeDataSource in project maven-archetype by apache.

the class DefaultArchetypeManager method updateLocalCatalog.

public void updateLocalCatalog(ProjectBuildingRequest buildingRequest, Archetype archetype) {
    try {
        ArchetypeDataSource source = archetypeSources.get("catalog");
        source.updateCatalog(buildingRequest, archetype);
    } catch (ArchetypeDataSourceException e) {
    }
}
Also used : ArchetypeDataSourceException(org.apache.maven.archetype.source.ArchetypeDataSourceException) ArchetypeDataSource(org.apache.maven.archetype.source.ArchetypeDataSource)

Example 3 with ArchetypeDataSource

use of org.apache.maven.archetype.source.ArchetypeDataSource in project intellij-community by JetBrains.

the class Maven2ServerIndexerImpl method doCollectArchetypes.

private void doCollectArchetypes(String roleHint, Set<MavenArchetype> result) throws RemoteException {
    try {
        ArchetypeDataSource source = myEmbedder.getComponent(ArchetypeDataSource.class, roleHint);
        ArchetypeCatalog catalog = source.getArchetypeCatalog(new Properties());
        for (Archetype each : (Iterable<? extends Archetype>) catalog.getArchetypes()) {
            result.add(Maven2ModelConverter.convertArchetype(each));
        }
    } catch (ArchetypeDataSourceException e) {
        Maven2ServerGlobals.getLogger().warn(e);
    }
}
Also used : MavenArchetype(org.jetbrains.idea.maven.model.MavenArchetype) Archetype(org.apache.maven.archetype.catalog.Archetype) ArchetypeDataSourceException(org.apache.maven.archetype.source.ArchetypeDataSourceException) ArchetypeDataSource(org.apache.maven.archetype.source.ArchetypeDataSource) ArchetypeCatalog(org.apache.maven.archetype.catalog.ArchetypeCatalog)

Aggregations

ArchetypeDataSource (org.apache.maven.archetype.source.ArchetypeDataSource)3 ArchetypeDataSourceException (org.apache.maven.archetype.source.ArchetypeDataSourceException)3 Archetype (org.apache.maven.archetype.catalog.Archetype)2 ArchetypeCatalog (org.apache.maven.archetype.catalog.ArchetypeCatalog)2 MavenArchetype (org.jetbrains.idea.maven.model.MavenArchetype)2