public static boolean isInstalled(Configuration configuration) { return configuration.containsKey(PROJECT_NAME_KEY); } }
@Override public String removeDirectProperty(String name) { Configuration subset = getConfiguration().subset(PROPERTIES_SUBSET_KEY); String value = subset.getString(name); subset.clearProperty(name); return value; }
@Override public MetadataFacet setDirectProperty(String name, String value) { Configuration subset = getConfiguration().subset(PROPERTIES_SUBSET_KEY); subset.setProperty(name, value); return this; }
@Override public String getProjectName() { return getConfiguration().getString(PROJECT_NAME_KEY); }
@Override public MetadataFacet setProjectName(String name) { getConfiguration().setProperty(PROJECT_NAME_KEY, name); return this; }
public String remoteRepository() { Configuration user = userConfig(); if (user.containsKey(REPOSITORY_KEY)) { return user.getString(REPOSITORY_KEY); } return defaultRemoteRepository(); }
protected Configuration getConfiguration() { return SimpleContainer.getServices(getClass().getClassLoader(), Configuration.class).get() .subset("maven.archetypes"); }
@Override public Result execute(UIExecutionContext context) throws Exception { getConfiguration().clearProperty(named.getValue()); getArchetypeCatalogFactoryRegistry().removeArchetypeCatalogFactory(named.getValue()); return Results.success(); }
private Configuration userConfig() { return getConfigFactory().getUserConfiguration(); }
@Override public String getProjectGroupName() { return getConfiguration().getString(PROJECT_GROUP_NAME_KEY); }
@Override public MetadataFacet setProjectVersion(String version) { getConfiguration().setProperty(PROJECT_VERSION_KEY, version); return this; }
public File localRepository() { Configuration user = userConfig(); if (user.containsKey(CLONE_LOCATION_KEY)) { return new File(user.getString(CLONE_LOCATION_KEY)); } return defaultLocalRepository(); }
private Configuration getArchetypeConfiguration() { return SimpleContainer.getServices(getClass().getClassLoader(), Configuration.class).get() .subset("maven.archetypes"); }
public CommandLineUtil(AddonRegistry addonRegistry) { this.converterFactory = addonRegistry.getServices(ConverterFactory.class).get(); ConfigurationFactory configFactory = addonRegistry.getServices(ConfigurationFactory.class).get(); this.userConfig = configFactory.getUserConfiguration(); }
@Override public String getProjectVersion() { return getConfiguration().getString(PROJECT_VERSION_KEY); }
@Override public MetadataFacet setProjectGroupName(String groupId) { getConfiguration().setProperty(PROJECT_GROUP_NAME_KEY, groupId); return this; }
private String getTargetDir() { String target = this.config.getString(FacesScaffoldProvider.class.getName() + "_targetDir"); target = Strings.isNullOrEmpty(target) ? "" : target; if (!target.startsWith("/")) { target = "/" + target; } if (target.endsWith("/")) { target = target.substring(0, target.length() - 1); } return target; }
public void setRemoteRepository(String repoUrl) { userConfig().setProperty(REPOSITORY_KEY, repoUrl); }
public String toOptionName(String name) { String optionNameStyle = userConfig.getString(OPTION_STYLE_PROPERTY, DASHED_OPTION_STYLE); return DASHED_OPTION_STYLE.equals(optionNameStyle) ? ShellUtil.shellifyOptionNameDashed(name) : ShellUtil.shellifyOptionName(name); } }
public void setLocalRepository(String location) { userConfig().setProperty(CLONE_LOCATION_KEY, location); }