public JpaPluginInstance(String artifactUri) { Artifact artifact = Artifact.create(artifactUri); this.groupId = artifact.getGroupId(); this.artifactId = artifact.getArtifactId(); this.version = artifact.getVersion().toString(); this.type = artifact.getType(); }
public Artifact queryArtifact(Artifact artifact) throws MultipleMatchesException { Artifact[] all = queryArtifacts(artifact); if(all.length > 1) { throw new MultipleMatchesException(artifact); } return all.length == 0 ? null : all[0]; }
private boolean matches(Dependency defaultDependency, Dependency actualDependency) { if (defaultDependency.getArtifact().matches(actualDependency.getArtifact()) || actualDependency.getArtifact().matches(defaultDependency.getArtifact())) { return defaultDependency.getImportType() == actualDependency.getImportType() || actualDependency.getImportType() == ImportType.ALL; } return false; }
protected Artifact newArtifact(Artifact configId, String artifactId) { return new Artifact(configId.getGroupId(), artifactId, configId.getVersion(), configId.getType()); }
/** * Creates a new artifact using entirely default values. * * @param defaultArtifact The artifactId to use for the new Artifact * @param defaultType The type to use for the new Artifact */ public Artifact createDefaultArtifact(String defaultArtifact, String defaultType) { return new Artifact(defaultGroup, defaultArtifact, defaultVersion, defaultType); }
protected void processClassloadingRules(Environment environment) { //Process Hidden Class for (String hiddenClassPrefix : environment.getClassLoadingRules().getHiddenRule().getClassPrefixes()) { String inversedImportPackage = hiddenClassPrefix.endsWith("*") ? hiddenClassPrefix : hiddenClassPrefix + "*"; environment.addImportPackage("!" + inversedImportPackage); } //Non-Overridable-Classes /*for (String hiddenClassPrefix : environment.getClassLoadingRules().getHiddenRule().getClassPrefixes()) { environment.getImportPackages().add(hiddenClassPrefix); }*/ }
public SnapshotVersion(Version version) { super(version.toString()); }
public ConfigurationData(Artifact configId, Naming naming, GBeanState gbeanState) { this(new Environment(configId), naming, gbeanState); }
public LocalSourceRepository(File base) { super(base); artifactResolver = new DefaultArtifactResolver(new DefaultArtifactManager(), this); }
protected Object fromString(String string) { return new Version(string); } }
private static ArtifactResolver createArtifactResolver(ArtifactResolver artifactResolver, ArtifactManager artifactManager, Collection repositories) { if (artifactResolver != null) { return artifactResolver; } return new DefaultArtifactResolver(artifactManager, repositories, null); }
public int compareTo(ModuleDetails o) { if (o != null ){ return configId.compareTo(o.configId); } else { return -1; } }
public int compareTo(Object object) { Artifact artifact = (Artifact) object; int i = safeCompare(groupId, artifact.groupId); if (i != 0) return i; i = safeCompare(artifactId, artifact.artifactId); if (i != 0) return i; i = safeCompare(version, artifact.version); if (i != 0) return i; i = safeCompare(type, artifact.type); return i; }
protected Object readResolve() { String name = this.name; return getByName(name); } }
public int hashCode() { return (artifact != null ? artifact.hashCode() : 0); }
public Artifact resolveInClassLoader(Artifact source) throws MissingDependencyException { return resolveInClassLoader(source, Collections.EMPTY_SET); }
public void install(WriteableRepository repo, FileWriteMonitor monitor) throws IOException { repo.copyToRepository(file, artifact, monitor); }
public static DependencyType toDependencyType(Dependency dep, boolean includeVersion) { Artifact id = dep.getArtifact(); DependencyType dependency = new DependencyType(); dependency.setGroupId(id.getGroupId()); dependency.setArtifactId(id.getArtifactId()); if (includeVersion) { dependency.setVersion(id.getVersion() == null ? null : id.getVersion().toString()); } dependency.setType(id.getType()); return dependency; }
public static ArtifactType toArtifactType(Artifact id) { ArtifactType artifact = new ArtifactType(); artifact.setGroupId(id.getGroupId()); artifact.setArtifactId(id.getArtifactId()); artifact.setVersion(id.getVersion() == null ? null : id.getVersion().toString()); artifact.setType(id.getType()); return artifact; }
public void parseEnvironment(Environment env) { ArtifactType moduleId = environment.addNewModuleId(); Artifact configId = env.getConfigId(); moduleId.setGroupId(configId.getGroupId()); moduleId.setArtifactId(configId.getArtifactId()); moduleId.setVersion(configId.getVersion().toString()); moduleId.setType(configId.getType()); //List<Dependency> deps = env.getDependencies(); //for (int i = 0; i < deps.size(); i++) { // String depString = deps.get(i).toString(); // dependenciesSet.add(depString.substring(6, depString.length() - 1)); //} }