org.apache.maven.model.Model.getDependencies()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(211)

本文整理了Java中org.apache.maven.model.Model.getDependencies()方法的一些代码示例,展示了Model.getDependencies()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.getDependencies()方法的具体详情如下:
包路径:org.apache.maven.model.Model
类名称:Model
方法名:getDependencies

Model.getDependencies介绍

暂无

代码示例

代码示例来源:origin: org.apache.maven/maven-project

private void assembleDependencyInheritance( Model child, Model parent )
{
  child.setDependencies( ModelUtils.mergeDependencyList( child.getDependencies(), parent.getDependencies() ) );
}

代码示例来源:origin: org.apache.maven/maven-project

public List getDependencies()
{
  return getModel().getDependencies();
}

代码示例来源:origin: apache/maven

public List<Dependency> getDependencies()
{
  return getModel().getDependencies();
}

代码示例来源:origin: apache/maven

@SuppressWarnings( "unchecked" )
private void assembleDependencyInheritance( Model child, Model parent )
{
  Map<String, Dependency> depsMap = new LinkedHashMap<>();
  List<Dependency> deps = parent.getDependencies();
  if ( deps != null )
  {
    for ( Dependency dependency : deps )
    {
      depsMap.put( dependency.getManagementKey(), dependency );
    }
  }
  deps = child.getDependencies();
  if ( deps != null )
  {
    for ( Dependency dependency : deps )
    {
      depsMap.put( dependency.getManagementKey(), dependency );
    }
  }
  child.setDependencies( new ArrayList<>( depsMap.values() ) );
}

代码示例来源:origin: apache/maven

List<Dependency> dependencies = model.getDependencies();
Map<String, Dependency> normalized = new LinkedHashMap<>( dependencies.size() * 2 );

代码示例来源:origin: apache/maven

public void mergeManagedDependencies( Model model )
{
  DependencyManagement dependencyManagement = model.getDependencyManagement();
  if ( dependencyManagement != null )
  {
    Map<Object, Dependency> dependencies = new HashMap<>();
    Map<Object, Object> context = Collections.emptyMap();
    for ( Dependency dependency : model.getDependencies() )
    {
      Object key = getDependencyKey( dependency );
      dependencies.put( key, dependency );
    }
    for ( Dependency managedDependency : dependencyManagement.getDependencies() )
    {
      Object key = getDependencyKey( managedDependency );
      Dependency dependency = dependencies.get( key );
      if ( dependency != null )
      {
        mergeDependency( dependency, managedDependency, false, context );
      }
    }
  }
}

代码示例来源:origin: apache/maven

@Override
public void injectDefaultValues( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
{
  injectDependencyDefaults( model.getDependencies() );
  Build build = model.getBuild();
  if ( build != null )
  {
    for ( Plugin plugin : build.getPlugins() )
    {
      injectDependencyDefaults( plugin.getDependencies() );
    }
  }
}

代码示例来源:origin: org.apache.maven/maven-project

public void injectDefaults( Model model )
{
  injectDependencyDefaults( model.getDependencies(), model.getDependencyManagement() );
  if ( model.getBuild() != null )
  {
    injectPluginDefaults( model.getBuild(), model.getBuild().getPluginManagement() );
  }
}

代码示例来源:origin: apache/maven

for ( org.apache.maven.model.Dependency dependency : model.getDependencies() )

代码示例来源:origin: org.apache.maven/maven-project

public void inject( Profile profile, Model model )
{
  model.setDependencies( injectDependencies( profile.getDependencies(), model.getDependencies() ) );
  injectModules( profile, model );
  model.setRepositories( ModelUtils.mergeRepositoryLists( profile.getRepositories(), model.getRepositories() ) );
  model.setPluginRepositories( ModelUtils.mergeRepositoryLists( profile.getPluginRepositories(), model
    .getPluginRepositories() ) );
  injectReporting( profile, model );
  injectDependencyManagement( profile, model );
  injectDistributionManagement( profile, model );
  injectBuild( profile, model );
  Properties props = new Properties();
  props.putAll( model.getProperties() );
  props.putAll( profile.getProperties() );
  model.setProperties( props );
}

代码示例来源:origin: org.apache.maven/maven-project

for ( Iterator it = model.getDependencies().iterator(); it.hasNext(); )

代码示例来源:origin: apache/maven

if ( ( model.getDependencies() != null ) && ( model.getDependencies().size() > 0 ) )
  for ( Iterator iter = model.getDependencies().iterator(); iter.hasNext(); )

代码示例来源:origin: takari/polyglot-maven

private void dependencies(PrintWriter pw, Model model) {
 deps(pw, "deps", model.getDependencies());
}

代码示例来源:origin: apache/maven

validateEffectiveDependencies( problems, m, m.getDependencies(), false, request );

代码示例来源:origin: apache/maven

validate20RawDependencies( problems, m.getDependencies(), "dependencies.dependency", request );
validate20RawDependenciesSelfReferencing( problems, m, m.getDependencies(), "dependencies.dependency",
                     request );

代码示例来源:origin: opensourceBIM/BIMserver

for (org.apache.maven.model.Dependency dependency : model.getDependencies()) {
  if (dependency.getGroupId().equals("org.opensourcebim") && (dependency.getArtifactId().equals("shared") || dependency.getArtifactId().equals("pluginbase"))) {

代码示例来源:origin: mulesoft/mule

/**
 * {@inheritDoc}
 */
@Override
public ConnectivityTestingServiceBuilder addDependency(String groupId, String artifactId, String artifactVersion,
                            String classifier, String type) {
 Dependency dependency = new Dependency();
 dependency.setGroupId(groupId);
 dependency.setArtifactId(artifactId);
 dependency.setVersion(artifactVersion);
 dependency.setType(type);
 dependency.setClassifier(classifier);
 if (!MULE_PLUGIN_CLASSIFIER.equals(classifier)) {
  addSharedLibraryDependency(model, dependency);
 }
 model.getDependencies().add(dependency);
 return this;
}

代码示例来源:origin: opensourceBIM/BIMserver

for (org.apache.maven.model.Dependency dependency : model.getDependencies()) {
  if (dependency.getGroupId().equals("org.opensourcebim") && (dependency.getArtifactId().equals("shared") || dependency.getArtifactId().equals("pluginbase"))) {

代码示例来源:origin: takari/polyglot-maven

private void writeDependencies() throws IOException {
  
  if (model.getDependencyManagement() != null && model.getDependencyManagement().getDependencies() != null && !model.getDependencyManagement().getDependencies().isEmpty()) {
    writeDependencies(model.getDependencyManagement().getDependencies(), "dependencyManagement");			
  }        
  writeDependencies(model.getDependencies(), "dependencies");
  writeBuild();
}

代码示例来源:origin: takari/polyglot-maven

void project(Model model) {
  String name = model.getName();
  if (name == null) {
    name = model.getArtifactId();
  }
  p.printStartBlock( "project", name, model.getUrl() );
  p.println();
  p.println( "model_version", model.getModelVersion() );
  p.println( "inception_year", model.getInceptionYear() );
  id(model);
  parent(model.getParent());
  p.println("packaging", model.getPackaging());
  p.println();
  description(model.getDescription());
  developers( model.getDevelopers() );
  issueManagement( model.getIssueManagement() );
  mailingLists( model.getMailingLists() );
  repositories( toRepositoryArray( model.getRepositories() ) );
  pluginRepositories( toRepositoryArray( model.getPluginRepositories() ) );
  sourceControl( model.getScm() );
  distribution( model.getDistributionManagement() );
  properties( model.getProperties() );
  dependencies( model.getDependencies() );
  modules( model.getModules() );
  managements( model.getDependencyManagement(), model.getBuild() );
  build( model.getBuild(), model.getBuild() );
  profiles( model.getProfiles() );
  reporting( model.getReporting() );
  p.printEndBlock();
}

相关文章

Model类方法