Search in sources :

Example 1 with MavenArchetype

use of org.jetbrains.idea.maven.model.MavenArchetype in project intellij-community by JetBrains.

the class MavenArchetypesStep method updateDataModel.

@Override
public void updateDataModel() {
    MavenArchetype selectedArchetype = getSelectedArchetype();
    myBuilder.setArchetype(selectedArchetype);
}
Also used : MavenArchetype(org.jetbrains.idea.maven.model.MavenArchetype)

Example 2 with MavenArchetype

use of org.jetbrains.idea.maven.model.MavenArchetype in project intellij-community by JetBrains.

the class MavenModuleWizardStep method saveSettings.

private void saveSettings() {
    saveValue(INHERIT_GROUP_ID_KEY, myInheritGroupIdCheckBox.isSelected());
    saveValue(INHERIT_VERSION_KEY, myInheritVersionCheckBox.isSelected());
    if (myArchetypes != null) {
        MavenArchetype arch = myArchetypes.getSelectedArchetype();
        saveValue(ARCHETYPE_GROUP_ID_KEY, arch == null ? null : arch.groupId);
        saveValue(ARCHETYPE_ARTIFACT_ID_KEY, arch == null ? null : arch.artifactId);
        saveValue(ARCHETYPE_VERSION_KEY, arch == null ? null : arch.version);
    }
}
Also used : MavenArchetype(org.jetbrains.idea.maven.model.MavenArchetype)

Example 3 with MavenArchetype

use of org.jetbrains.idea.maven.model.MavenArchetype in project intellij-community by JetBrains.

the class MavenModuleWizardStep method loadSettings.

private void loadSettings() {
    myBuilder.setInheritedOptions(getSavedValue(INHERIT_GROUP_ID_KEY, true), getSavedValue(INHERIT_VERSION_KEY, true));
    String archGroupId = getSavedValue(ARCHETYPE_GROUP_ID_KEY, null);
    String archArtifactId = getSavedValue(ARCHETYPE_ARTIFACT_ID_KEY, null);
    String archVersion = getSavedValue(ARCHETYPE_VERSION_KEY, null);
    if (archGroupId == null || archArtifactId == null || archVersion == null) {
        myBuilder.setArchetype(null);
    } else {
        myBuilder.setArchetype(new MavenArchetype(archGroupId, archArtifactId, archVersion, null, null));
    }
}
Also used : MavenArchetype(org.jetbrains.idea.maven.model.MavenArchetype)

Example 4 with MavenArchetype

use of org.jetbrains.idea.maven.model.MavenArchetype in project intellij-community by JetBrains.

the class MavenIndicesManagerTest method testAddingArchetypes.

public void testAddingArchetypes() throws Exception {
    myIndicesFixture.getIndicesManager().addArchetype(new MavenArchetype("myGroup", "myArtifact", "666", null, null));
    assertArchetypeExists("myGroup:myArtifact:666");
    myIndicesFixture.tearDown();
    myIndicesFixture.setUp();
    assertArchetypeExists("myGroup:myArtifact:666");
}
Also used : MavenArchetype(org.jetbrains.idea.maven.model.MavenArchetype)

Example 5 with MavenArchetype

use of org.jetbrains.idea.maven.model.MavenArchetype in project intellij-community by JetBrains.

the class MavenIndicesManagerTest method assertArchetypeExists.

private void assertArchetypeExists(String archetypeId) {
    Set<MavenArchetype> achetypes = myIndicesFixture.getIndicesManager().getArchetypes();
    List<String> actualNames = new ArrayList<>();
    for (MavenArchetype each : achetypes) {
        actualNames.add(each.groupId + ":" + each.artifactId + ":" + each.version);
    }
    assertTrue(actualNames.toString(), actualNames.contains(archetypeId));
}
Also used : ArrayList(java.util.ArrayList) MavenArchetype(org.jetbrains.idea.maven.model.MavenArchetype)

Aggregations

MavenArchetype (org.jetbrains.idea.maven.model.MavenArchetype)16 MavenId (org.jetbrains.idea.maven.model.MavenId)3 IOException (java.io.IOException)2 Archetype (org.apache.maven.archetype.catalog.Archetype)2 ArchetypeCatalog (org.apache.maven.archetype.catalog.ArchetypeCatalog)2 ArchetypeDataSource (org.apache.maven.archetype.source.ArchetypeDataSource)2 ArchetypeDataSourceException (org.apache.maven.archetype.source.ArchetypeDataSourceException)2 Element (org.jdom.Element)2 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 JDOMException (org.jdom.JDOMException)1 MavenProject (org.jetbrains.idea.maven.project.MavenProject)1