public static String toMavenCoords(FeaturePackLocation fpl) throws ProvisioningException { final String producer = fpl.getProducerName(); final int colon = producer.indexOf(':'); if(colon <= 0) { throw new ProvisioningException("Failed to determine group and artifact IDs for " + fpl); } final StringBuilder buf = new StringBuilder(); buf.append(producer.substring(0, colon)).append(':').append(producer.substring(colon + 1)).append(':').append(ZIP); buf.append(':').append(fpl.getBuild()); return buf.toString(); }
default FeaturePackUpdatePlan getUpdatePlan(FeaturePackUpdatePlan.Request updateRequest) throws ProvisioningException { final FeaturePackLocation fpl = updateRequest.getInstalledLocation(); String latestBuild = null; try { latestBuild = getLatestBuild(fpl); } catch(LatestVersionNotAvailableException e) { // that also means no update } if (latestBuild != null && !(latestBuild.equals(fpl.getBuild()))) { updateRequest.setNewLocation(fpl.replaceBuild(latestBuild)); } return updateRequest.buildPlan(); }
@Override public void visit(Producer<?> producer, FeaturePackLocation loc) { if (loc.getFrequency() == null) { return; } if (allFrequencies || loc.getFrequency().equals(producer.getDefaultFrequency())) { Table table = tables.get(loc.getUniverse()); if (table == null) { table = new Table(Headers.PRODUCT, Headers.UPDATE_CHANNEL, Headers.LATEST_BUILD); tables.put(loc.getUniverse(), table); } loc = invoc.getPmSession().getExposedLocation(finalPath, loc); table.addLine(producer.getName(), StateInfoUtil.formatChannel(loc), (loc.getBuild() == null ? NONE : loc.getBuild())); } }
public FeaturePackLocation getUserConfiguredLocation(FeaturePackLocation fpl) { final UniverseSpec universeSource = fpl.getUniverse(); if(defaultUniverse != null && defaultUniverse.equals(universeSource)) { return new FeaturePackLocation(null, fpl.getProducerName(), fpl.getChannelName(), fpl.getFrequency(), fpl.getBuild()); } for (Map.Entry<String, UniverseSpec> entry : universeSpecs.entrySet()) { if (entry.getValue().equals(universeSource)) { return new FeaturePackLocation(new UniverseSpec(entry.getKey(), null), fpl.getProducerName(), fpl.getChannelName(), fpl.getFrequency(), fpl.getBuild()); } } return fpl; }
List<Cell> line = new ArrayList<>(); line.add(new Cell(d.getProducerName())); line.add(new Cell(d.getBuild())); if (showPatches) { FeaturePackConfig config = configs.get(d.getFPID());
List<Cell> line = new ArrayList<>(); line.add(new Cell(loc.getProducer().getName())); line.add(new Cell(loc.getBuild())); if (showPatches) { if (c.hasPatches()) {
static FeaturePackLocation resolveUniverse(FeaturePackDepsConfigBuilder<?> builder, FeaturePackLocation location) throws XMLStreamException { if(location.getUniverse() == null) { if(!builder.hasDefaultUniverse()) { throw new XMLStreamException("Failed to parse feature-pack configuration for " + location + ": default universe was not configured"); } location = new FeaturePackLocation(builder.getDefaultUniverse(), location.getProducerName(), location.getChannelName(), location.getFrequency(), location.getBuild()); } else { final UniverseSpec resolvedConfig = builder.getUniverseSpec(location.getUniverse().toString()); if(resolvedConfig != null) { location = new FeaturePackLocation(resolvedConfig, location.getProducerName(), location.getChannelName(), location.getFrequency(), location.getBuild()); } } return location; }
static FeaturePackLocation resolveUniverse(FeaturePackDepsConfigBuilder<?> builder, FeaturePackLocation location) throws XMLStreamException { if(location.getUniverse() == null) { if(!builder.hasDefaultUniverse()) { throw new XMLStreamException("Failed to parse feature-pack configuration for " + location + ": default universe was not configured"); } location = new FeaturePackLocation(builder.getDefaultUniverse(), location.getProducerName(), location.getChannelName(), location.getFrequency(), location.getBuild()); } else { final UniverseSpec resolvedConfig = builder.getUniverseSpec(location.getUniverse().toString()); if(resolvedConfig != null) { location = new FeaturePackLocation(resolvedConfig, location.getProducerName(), location.getChannelName(), location.getFrequency(), location.getBuild()); } } return location; }
continue; if(fpl.getBuild() == null) { continue; if(fpl.getBuild() == null) { fpl = layoutFactory.getUniverseResolver().resolveLatestBuild(fpl); if(resolvedVersions == null) { } else if(!branchId.getBuild().equals(fpl.getBuild())) { fpl = fpl.replaceBuild(branchId.getBuild()); if(branchId == null && !fpl.getBuild().equals(fp.getFPID().getBuild())) { Set<FPID> versions = conflicts.get(fp.getFPID().getProducer()); if(versions != null) {
public static void printFeaturePack(PmCommandInvocation commandInvocation, FeaturePackLocation loc) { loc = commandInvocation.getPmSession().getExposedLocation(null, loc); Table t = new Table(Headers.PRODUCT, Headers.BUILD, Headers.UPDATE_CHANNEL); t.addLine(loc.getProducer().getName(), loc.getBuild(), formatChannel(loc)); commandInvocation.print(t.build()); }
throw new ProvisioningDescriptionException("Feature-pack channel has not been set"); if(fps.getBuild() == null) { throw new ProvisioningDescriptionException("Feature-pack build number has not been set");
private FeaturePackLocation getResolvedLocation(Path installation, FeaturePackLocation fplocation) throws ProvisioningException { UniverseSpec spec = fplocation.getUniverse(); if (spec != null) { if (spec.getLocation() == null) { spec = universe.getUniverseSpec(installation, spec.getFactory()); if (spec == null) { throw new ProvisioningException("Unknown universe for " + fplocation); } } } else { spec = universe.getDefaultUniverseSpec(installation); } return new FeaturePackLocation(spec, fplocation.getProducerName(), fplocation.getChannelName(), fplocation.getFrequency(), fplocation.getBuild()); }
public FeaturePackLocation getExposedLocation(Path installation, FeaturePackLocation fplocation) { // Expose the default or name. UniverseSpec spec = fplocation.getUniverse(); boolean rewrite = false; String name = getUniverse().getUniverseName(installation, spec); if (name != null) { rewrite = true; spec = new UniverseSpec(name, null); } else if (getUniverse().getDefaultUniverseSpec(installation).equals(spec)) { rewrite = true; spec = null; } if (rewrite) { fplocation = new FeaturePackLocation(spec, fplocation.getProducerName(), fplocation.getChannelName(), fplocation.getFrequency(), fplocation.getBuild()); } return fplocation; } public void enableMavenTrace(boolean b) {
final FeaturePackUpdatePlan fpPlan = updates.get(producer); if(fpPlan != null && !fpPlan.isEmpty()) { if(fpConfig.getLocation().getBuild() != null && !fpPlan.getInstalledLocation().equals(fpConfig.getLocation())) { throw new ProvisioningException("Update plan build " + fpPlan.getInstalledLocation() + " does not match the installed build " + fpConfig.getLocation());