protected Object fromString(String string) { return new Version(string); } }
public Artifact(String groupId, String artifactId, String version, String type) { this(groupId, artifactId, version == null ? null : new Version(version), type); }
public ModuleIDBuilder() { defaultVersion = new Version(Long.toString(System.currentTimeMillis())); defaultGroup = Artifact.DEFAULT_GROUP_ID; }
public Artifact generateArtifact(Artifact source, String defaultType) { if(source.isResolved()) { Artifact deAliased = (Artifact) explicitResolution.get(source); if (deAliased != null) { return deAliased; } return source; } String groupId = source.getGroupId() == null ? Artifact.DEFAULT_GROUP_ID : source.getGroupId(); String artifactId = source.getArtifactId(); String type = source.getType() == null ? defaultType : source.getType(); Version version = source.getVersion() == null ? new Version(Long.toString(System.currentTimeMillis())) : source.getVersion(); return new Artifact(groupId, artifactId, version, type); }
private Artifact resolve(Artifact configID) throws DeploymentException { String group = configID.getGroupId(); if (group == null) { group = Artifact.DEFAULT_GROUP_ID; } String artifactId = configID.getArtifactId(); if (artifactId == null) { throw new DeploymentException("Every configuration to deploy must have a ConfigID with an ArtifactID (not " + configID + ")"); } Version version = configID.getVersion(); if (version == null) { version = new Version(Long.toString(System.currentTimeMillis())); } String type = configID.getType(); if (type == null) { type = "car"; } return new Artifact(group, artifactId, version, type); }
Version[] available = new Version[list.getLength()]; for (int i = 0; i < available.length; i++) { available[i] = new Version(getText(list.item(i)));