Search in sources :

Example 11 with Archetype

use of io.fabric8.tooling.archetype.catalog.Archetype in project fabric8 by jboss-fuse.

the class ArchetypeInfoAction method doExecute.

@Override
protected Object doExecute() throws Exception {
    // try artifact first
    Archetype archetype = archetypeService.getArchetypeByArtifact(archetypeGAV);
    if (archetype == null) {
        // then by coordinate
        archetypeService.getArchetype(archetypeGAV);
    }
    if (archetype != null) {
        System.out.println(String.format(FORMAT, "GroupId:", archetype.groupId));
        System.out.println(String.format(FORMAT, "ArtifactId:", archetype.artifactId));
        System.out.println(String.format(FORMAT, "Version:", archetype.version));
        System.out.println(String.format(FORMAT, "Coordinate:", toMavenCoordinate(archetype)));
        System.out.println(String.format(FORMAT, "Description:", emptyIfNull(archetype.description)));
        System.out.println(String.format(FORMAT, "Repository:", emptyIfNull(archetype.repository)));
    } else {
        System.err.println("No archetype found for: " + archetypeGAV);
    }
    return null;
}
Also used : Archetype(io.fabric8.tooling.archetype.catalog.Archetype)

Example 12 with Archetype

use of io.fabric8.tooling.archetype.catalog.Archetype in project fabric8 by fabric8io.

the class ProjectsPage method createProject.

/**
 * Creates a new project using the create projects wizard and asserts it appears on the projects page
 */
public void createProject(NewProjectFormData form) {
    goToProjectsPage();
    WebDriverFacade facade = getFacade();
    facade.untilLinkClicked(createProjectBy);
    By nextButton = By.xpath("//button[@ng-click='execute()']");
    // it can take a while to load pages in the wizard to lets increase the wait time lots! :)
    facade.setDefaultTimeoutInSeconds(60 * 9);
    String named = form.getNamed();
    facade.form().clearAndSendKeys(By.xpath("//input[@ng-model='entity.named']"), named).submitButton(nextButton).submit();
    facade.form().completeComboBox(By.xpath("//label[text() = 'Archetype']/following::input[@type='text']"), form.getArchetypeFilter()).submitButton(nextButton).submit();
    untilNextWizardPage(facade, nextButton);
    facade.form().submitButton(nextButton).submit();
    untilNextWizardPage(facade, nextButton);
    facade.form().completeComboBox(By.xpath("//label[text() = 'Flow']/following::input[@type='text']"), form.getJenkinsFileFilter()).submitButton(nextButton).submit();
    facade.untilIsDisplayed(By.xpath("//a[@href='/forge/repos' and text()='Done']"));
    logInfo("Created project: " + named);
    goToProjectsPage();
    // lets assert there's a link to the project page
    facade.untilIsDisplayed(By.partialLinkText(named));
}
Also used : WebDriverFacade(io.fabric8.selenium.WebDriverFacade) By(org.openqa.selenium.By)

Example 13 with Archetype

use of io.fabric8.tooling.archetype.catalog.Archetype in project fabric8 by fabric8io.

the class ArchetypeTest method assertArchetypeCreated.

private void assertArchetypeCreated(String artifactId, String groupId, String version) throws Exception {
    AetherResult result = aether.resolve(groupId, artifactId, version);
    List<File> files = result.getResolvedFiles();
    assertTrue("No files resolved for " + artifactId + " version: " + version, files.size() > 0);
    File archetypejar = files.get(0);
    assertTrue("archetype jar does not exist", archetypejar.exists());
    assertArchetypeCreated(artifactId, groupId, version, archetypejar);
}
Also used : AetherResult(io.fabric8.insight.maven.aether.AetherResult) File(java.io.File)

Aggregations

Archetype (io.fabric8.tooling.archetype.catalog.Archetype)7 File (java.io.File)6 MavenResolver (io.fabric8.maven.MavenResolver)2 Archetypes (io.fabric8.tooling.archetype.catalog.Archetypes)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 DownloadCallback (io.fabric8.agent.download.DownloadCallback)1 DownloadManager (io.fabric8.agent.download.DownloadManager)1 Downloader (io.fabric8.agent.download.Downloader)1 StreamProvider (io.fabric8.agent.download.StreamProvider)1 FabricRequirements (io.fabric8.api.FabricRequirements)1 AetherResult (io.fabric8.insight.maven.aether.AetherResult)1 WebDriverFacade (io.fabric8.selenium.WebDriverFacade)1 ArchetypeUtils (io.fabric8.tooling.archetype.ArchetypeUtils)1 ArchetypeHelper (io.fabric8.tooling.archetype.generator.ArchetypeHelper)1 TablePrinter (io.fabric8.utils.TablePrinter)1 IOException (java.io.IOException)1 StringReader (java.io.StringReader)1 StringWriter (java.io.StringWriter)1 URL (java.net.URL)1