本文整理了Java中org.apache.geronimo.kernel.repository.Artifact.getArtifactId()
方法的一些代码示例,展示了Artifact.getArtifactId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Artifact.getArtifactId()
方法的具体详情如下:
包路径:org.apache.geronimo.kernel.repository.Artifact
类名称:Artifact
方法名:getArtifactId
暂无
代码示例来源:origin: org.apache.geronimo.modules/geronimo-deploy-farm
public boolean isMasterConfigurationName(Artifact configId) {
return configId.getArtifactId().endsWith(ARTIFACT_SUFFIX);
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
private void removeArtifact(Artifact artifact) {
List values = (List) artifactsByArtifact.get(artifact.getArtifactId());
if (values != null) {
values.remove(artifact);
if (values.isEmpty()) {
artifactsByArtifact.remove(artifact.getArtifactId());
}
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
private void processArtifact(Artifact artifact) {
List values = (List) artifactsByArtifact.get(artifact.getArtifactId());
if (values == null) {
values = new ArrayList();
artifactsByArtifact.put(artifact.getArtifactId(), values);
}
values.add(artifact);
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public SortedSet getLoadedArtifacts(Artifact query) {
List values = (List) artifactsByArtifact.get(query.getArtifactId());
SortedSet results = new TreeSet();
if (values != null) {
for (int i = 0; i < values.size(); i++) {
Artifact test = (Artifact) values.get(i);
if(query.matches(test)) {
results.add(test);
}
}
}
return results;
}
代码示例来源:origin: org.apache.geronimo.framework/geronimo-bundle-recorder
private String getMvnLocationFromArtifact(Artifact artifact){
if (artifact == null) return null;
StringBuilder bundleLocation = new StringBuilder();
bundleLocation.append("mvn:");
bundleLocation.append(artifact.getGroupId()).append('/').append(artifact.getArtifactId()).append('/').append(artifact.getVersion());
return bundleLocation.toString();
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-deploy-farm
public Artifact buildMasterConfigurationName(Artifact configId) {
return newArtifact(configId, configId.getArtifactId() + ARTIFACT_SUFFIX);
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-deploy-farm
public Artifact buildSlaveConfigurationName(Artifact configId) {
if (!isMasterConfigurationName(configId)) {
throw new IllegalArgumentException("[" + configId + "] is not a master configuration name");
}
String artifactId = configId.getArtifactId();
return newArtifact(configId, artifactId.substring(0, artifactId.length() - ARTIFACT_SUFFIX.length()));
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public File getLocation(Artifact artifact) {
if(!artifact.isResolved()) {
throw new IllegalArgumentException("Artifact "+artifact+" is not fully resolved");
}
File path = new File(rootFile, artifact.getGroupId().replace('.', File.separatorChar));
path = new File(path, artifact.getArtifactId());
path = new File(path, artifact.getVersion().toString());
path = new File(path, artifact.getArtifactId() + "-" + artifact.getVersion() + "." + artifact.getType());
return path;
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public File getLocation(Artifact artifact) {
File path = new File(rootFile, artifact.getGroupId());
path = new File(path, artifact.getType() + "s");
String ext = artifact.getType();
if(ext.equals("ejb")) {
ext = "jar";
}
path = new File(path, artifact.getArtifactId() + "-" + artifact.getVersion() + "." + ext);
return path;
}
代码示例来源:origin: org.apache.geronimo.plugins/console-base-portlets
private WebModule getWebModule(Configuration config, Configuration child) {
try {
Map<String, String> query1 = new HashMap<String, String>();
String name = config.getId().getArtifactId();
query1.put("J2EEApplication", config.getId().toString());
query1.put("j2eeType", "WebModule");
query1.put("name", child.getId().getArtifactId().substring(name.length()+1));
AbstractName childName = new AbstractName(config.getAbstractName().getArtifact(), query1);
return (WebModule)kernel.getGBean(childName);
} catch(Exception h){
// No gbean found, will not happen
// Except if module not started, ignored
}
return null;
}
代码示例来源:origin: org.apache.geronimo.framework/geronimo-plugin
private URL getURL(Artifact configId) throws MalformedURLException {
String qualifiedVersion = configId.getVersion().toString();
if (configId.getVersion() instanceof SnapshotVersion) {
SnapshotVersion ssVersion = (SnapshotVersion) configId.getVersion();
String timestamp = ssVersion.getTimestamp();
int buildNumber = ssVersion.getBuildNumber();
if (timestamp != null && buildNumber != 0) {
qualifiedVersion = qualifiedVersion.replaceAll("SNAPSHOT", timestamp + "-" + buildNumber);
}
}
return base.resolve(configId.getGroupId().replace('.', '/') + "/"
+ configId.getArtifactId() + "/" + configId.getVersion()
+ "/" + configId.getArtifactId() + "-"
+ qualifiedVersion + "." + configId.getType()).toURL();
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
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);
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-plugin-farm
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();
}
代码示例来源:origin: org.apache.servicemix.geronimo/servicemix-service
private void undeploy(ServiceUnitReference reference) {
try {
Component componentGBean = getComponentGBean(
reference.getAssocialtedServiceUnitName().getArtifactId(),
reference.getAssocialtedServiceUnitName());
ServiceUnitManager serviceUnitManager =
componentGBean.getComponent().getServiceUnitManager();
serviceUnitManager.undeploy(reference.getServiceUnitName(),
reference.getServiceUnitPath());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.apache.geronimo.framework/geronimo-service-builder
private static void fillArtifactType(Artifact artifact, ArtifactType artifactType) {
if (artifact.getGroupId() != null) {
artifactType.setGroupId(artifact.getGroupId());
}
if (artifact.getArtifactId() != null) {
artifactType.setArtifactId(artifact.getArtifactId());
}
if (artifact.getVersion() != null) {
artifactType.setVersion(artifact.getVersion().toString());
}
if (artifact.getType() != null) {
artifactType.setType(artifact.getType());
}
}
代码示例来源:origin: org.apache.geronimo.plugins/plancreator-portlets
private void populateDependency(DependencyType dep, String dependencyString) {
Artifact artifact = Artifact.create(dependencyString.trim());
dep.setArtifactId(artifact.getArtifactId());
if (artifact.getGroupId() != null) {
dep.setGroupId(artifact.getGroupId());
}
if (artifact.getType() != null) {
dep.setType(artifact.getType());
}
if (artifact.getVersion() != null) {
dep.setVersion(artifact.getVersion().toString());
}
}
代码示例来源:origin: org.apache.geronimo.framework/geronimo-plugin
public PluginType getPlugin(Artifact sourceArtifact) {
PluginType plugin = new PluginType();
PluginArtifactType pluginArtifact = new PluginArtifactType();
ArtifactType artifact = new ArtifactType();
artifact.setGroupId(sourceArtifact.getGroupId());
artifact.setArtifactId(sourceArtifact.getArtifactId());
artifact.setVersion(sourceArtifact.getVersion().toString());
artifact.setType(sourceArtifact.getType());
pluginArtifact.setModuleId(artifact);
plugin.getPluginArtifact().add(pluginArtifact);
return plugin;
}
代码示例来源:origin: org.apache.geronimo.plugins/plancreator-portlets
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));
//}
}
代码示例来源:origin: org.apache.geronimo.framework/geronimo-plugin
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;
}
代码示例来源:origin: org.apache.geronimo.framework/geronimo-plugin
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;
}
内容来源于网络,如有侵权,请联系作者删除!