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

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

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

Model.getParent介绍

[英]Get the location of the parent project, if one exists. Values from the parent project will be the default for this project if they are left unspecified. The location is given as a group ID, artifact ID and version.
[中]获取父项目的位置(如果存在)。如果未指定父项目中的值,则它们将是此项目的默认值。位置以组ID、工件ID和版本的形式给出。

代码示例

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

private ModelSource getParentPomFile( Model childModel, ModelSource source )
{
  if ( !( source instanceof ModelSource2 ) )
  {
    return null;
  }
  String parentPath = childModel.getParent().getRelativePath();
  if ( parentPath == null || parentPath.length() <= 0 )
  {
    return null;
  }
  return ( (ModelSource2) source ).getRelatedSource( parentPath );
}

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

public String getVersion()
{
  String version = getModel().getVersion();
  if ( ( version == null ) && ( getModel().getParent() != null ) )
  {
    version = getModel().getParent().getVersion();
  }
  
  return version;
}

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

public String getGroupId()
{
  String groupId = getModel().getGroupId();
  if ( ( groupId == null ) && ( getModel().getParent() != null ) )
  {
    groupId = getModel().getParent().getGroupId();
  }
  
  return groupId;
}

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

protected void mergeModel_Parent( Model target, Model source, boolean sourceDominant, Map<Object, Object> context )
{
  Parent src = source.getParent();
  if ( src != null )
  {
    Parent tgt = target.getParent();
    if ( tgt == null )
    {
      tgt = new Parent();
      tgt.setRelativePath( null );
      target.setParent( tgt );
    }
    mergeParent( tgt, src, sourceDominant, context );
  }
}

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

public String getVersion()
{
  String version = getModel().getVersion();
  if ( ( version == null ) && ( getModel().getParent() != null ) )
  {
    version = getModel().getParent().getVersion();
  }
  return version;
}

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

public String getGroupId()
{
  String groupId = getModel().getGroupId();
  if ( ( groupId == null ) && ( getModel().getParent() != null ) )
  {
    groupId = getModel().getParent().getGroupId();
  }
  return groupId;
}

代码示例来源:origin: kiegroup/drools

projVersionStr = model.getVersion();
if( projVersionStr == null ) {
  projVersionStr = model.getParent().getVersion();

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

static String toId( Model model )
{
  if ( model == null )
  {
    return "";
  }
  String groupId = model.getGroupId();
  if ( groupId == null && model.getParent() != null )
  {
    groupId = model.getParent().getGroupId();
  }
  String artifactId = model.getArtifactId();
  String version = model.getVersion();
  if ( version == null )
  {
    version = "[unknown-version]";
  }
  return toId( groupId, artifactId, version );
}

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

Parent parent = project.getModel().getParent();

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

if ( interpolatedModel.getParent() != null )
    String interpolated = ssi.interpolate( interpolatedModel.getParent().getVersion() );
    interpolatedModel.getParent().setVersion( interpolated );
      new ModelProblemCollectorRequest( Severity.ERROR,
                       Version.BASE ).setMessage( "Failed to interpolate field: "
                         + interpolatedModel.getParent().getVersion()
                         + " on class: " ).setException( e );
    problems.add( mpcr );

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

Parent parent = model.getParent();
if ( parent != null )

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

throws ModelBuildingException
final Parent parent = childModel.getParent();
final ModelSource candidateSource;
final Model candidateModel;
if ( groupId == null && candidateModel.getParent() != null )
  groupId = candidateModel.getParent().getGroupId();
if ( version == null && candidateModel.getParent() != null )
  version = candidateModel.getParent().getVersion();

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

Parent parent = childModel.getParent().clone();

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

Parent parentModel = model.getParent();
      if ( ( candidateParentGroupId == null ) && ( candidateParent.getParent() != null ) )
        candidateParentGroupId = candidateParent.getParent().getGroupId();
      if ( ( candidateParentVersion == null ) && ( candidateParent.getParent() != null ) )
        candidateParentVersion = candidateParent.getParent().getVersion();

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

if ( child.getParent() != null )
  child.setVersion( child.getParent().getVersion() );

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

if ( child.getParent() != null )
  child.setVersion( child.getParent().getVersion() );

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

Parent parent = childModel.getParent();

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

resultData.setModel( resultModel );
if ( resultModel.getParent() != null )

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

result.setOrganization( cloneOrganization( src.getOrganization() ) );
result.setPackaging( src.getPackaging() );
result.setParent( cloneParent( src.getParent() ) );

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

@Override
public void validateRawModel( Model m, ModelBuildingRequest request, ModelProblemCollector problems )
  Parent parent = m.getParent();
  if ( parent != null )

相关文章

Model类方法