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