本文整理了Java中org.apache.maven.model.Model.removeDependency()
方法的一些代码示例,展示了Model.removeDependency()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.removeDependency()
方法的具体详情如下:
包路径:org.apache.maven.model.Model
类名称:Model
方法名:removeDependency
暂无
代码示例来源:origin: simpligility/android-maven-plugin
if ( providedJar != null )
project.getModel().removeDependency( providedJar );
代码示例来源:origin: com.buschmais.jqassistant.plugin/jqassistant.plugin.m2repo
@Override
public void removeDependency(Dependency dependency) {
delegate.removeDependency(dependency);
}
代码示例来源:origin: minnal/minnal
@Override
public void init() {
super.init();
File pom = new File(baseDir, POM_FILE);
if (pom.exists()) {
logger.trace("pom already exist. Reading it");
MavenXpp3Reader reader = new MavenXpp3Reader();
FileInputStream stream = null;
try {
stream = new FileInputStream(pom);
model = reader.read(stream);
} catch (Exception e) {
throw new MinnalGeneratorException("Failed while reading the pom - " + pom.getName(), e);
} finally {
closeStream(stream);
}
} else {
model = createMavenModel();
}
for (Dependency dependency : dependenciesToAdd) {
if (!model.getDependencies().contains(dependency)) {
model.addDependency(dependency);
}
}
for (Dependency dependency : dependenciesToRemove) {
model.removeDependency(dependency);
}
}
代码示例来源:origin: org.codehaus.mevenide/nb-project
Dependency dep = (Dependency) it.next();
if (art.getArtifactId().equals(dep.getArtifactId()) && art.getGroupId().equals(dep.getGroupId())) {
model.removeDependency(dep);
break;
代码示例来源:origin: com.paypal.butterfly/butterfly-utilities
@Override
protected TOExecutionResult pomExecution(String relativePomFile, Model model) {
TOExecutionResult result = null;
String details;
Dependency dependency = getDependency(model, groupId, artifactId);
if (dependency != null) {
model.removeDependency(dependency);
details = String.format("Dependency %s:%s has been removed from POM file %s", groupId, artifactId, relativePomFile);
result = TOExecutionResult.success(this, details);
} else {
details = String.format("Dependency %s:%s has NOT been removed from POM file %s because it is not present", groupId, artifactId, relativePomFile);
switch (ifNotPresent) {
case Warn:
result = TOExecutionResult.warning(this, new TransformationOperationException(details));
break;
case NoOp:
result = TOExecutionResult.noOp(this, details);
break;
case Fail:
// Fail is the default
default:
result = TOExecutionResult.error(this, new TransformationOperationException(details));
break;
}
}
return result;
}
代码示例来源:origin: com.paypal.butterfly/butterfly-utilities
model.removeDependency(dependency);
代码示例来源:origin: com.paypal.butterfly/butterfly-utilities
model.removeDependency(dependency);
内容来源于网络,如有侵权,请联系作者删除!