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

x33g5p2x  于2022-01-26 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(123)

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

Parent.getArtifactId介绍

[英]Get the artifact id of the parent project to inherit from.
[中]获取要从中继承的父项目的工件id。

代码示例

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

/**
 * @return the id as <code>groupId:artifactId:version</code>
 */
public String getId()
{
  StringBuilder id = new StringBuilder( 64 );
  id.append( getGroupId() );
  id.append( ":" );
  id.append( getArtifactId() );
  id.append( ":" );
  id.append( "pom" );
  id.append( ":" );
  id.append( getVersion() );
  return id.toString();
}

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

protected void mergeParent_ArtifactId( Parent target, Parent source, boolean sourceDominant,
                    Map<Object, Object> context )
{
  String src = source.getArtifactId();
  if ( src != null )
  {
    if ( sourceDominant || target.getArtifactId() == null )
    {
      target.setArtifactId( src );
      target.setLocation( "artifactId", source.getLocation( "artifactId" ) );
    }
  }
}

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

addEdge( projectMap, vertexMap, null, projectVertex, parent.getGroupId(), parent.getArtifactId(),
     parent.getVersion(), true, false );

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

public static Parent cloneParent( Parent src )
{
  if ( src == null )
  {
    return null;
  }
  Parent result = new Parent();
  result.setArtifactId( src.getArtifactId() );
  result.setGroupId( src.getGroupId() );
  result.setRelativePath( src.getRelativePath() );
  result.setVersion( src.getVersion() );
  
  return result;
}

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

final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom",
                        parent.getVersion() );
    String.format( "No versions matched the requested parent version range '%s'",
            parent.getVersion() ),
    parent.getGroupId(), parent.getArtifactId(), parent.getVersion() );
    String.format( "The requested parent version range '%s' does not specify an upper bound",
            parent.getVersion() ),
    parent.getGroupId(), parent.getArtifactId(), parent.getVersion() );
return resolveModel( parent.getGroupId(), parent.getArtifactId(), parent.getVersion() );
throw new UnresolvableModelException( e.getMessage(), parent.getGroupId(), parent.getArtifactId(),
                   parent.getVersion(), e );

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

final Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom",
                        parent.getVersion() );
    String.format( "No versions matched the requested parent version range '%s'",
            parent.getVersion() ),
    parent.getGroupId(), parent.getArtifactId(), parent.getVersion() );
    String.format( "The requested parent version range '%s' does not specify an upper bound",
            parent.getVersion() ),
    parent.getGroupId(), parent.getArtifactId(), parent.getVersion() );
return resolveModel( parent.getGroupId(), parent.getArtifactId(), parent.getVersion() );
throw new UnresolvableModelException( e.getMessage(), parent.getGroupId(), parent.getArtifactId(),
                   parent.getVersion(), e );

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

parent.getArtifactId().equals( model.getArtifactId() ) )

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

String artifactId = parent.getArtifactId();
String version = parent.getVersion();
ModelData parentData = new ModelData( modelSource, parentModel, parent.getGroupId(), parent.getArtifactId(),
                   parent.getVersion() );

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

resolver.resolveRawModel( parent.getGroupId(), parent.getArtifactId(), parent.getVersion() );
|| !artifactId.equals( parent.getArtifactId() ) )
buffer.append( parent.getArtifactId() ).append( ", please verify your project structure" );

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

/**
 * Method writeParent.
 * 
 * @param parent
 * @param serializer
 * @param tagName
 * @throws java.io.IOException
 */
private void writeParent( Parent parent, String tagName, XmlSerializer serializer )
  throws java.io.IOException
{
  serializer.startTag( NAMESPACE, tagName );
  if ( parent.getGroupId() != null )
  {
    serializer.startTag( NAMESPACE, "groupId" ).text( parent.getGroupId() ).endTag( NAMESPACE, "groupId" );
  }
  if ( parent.getArtifactId() != null )
  {
    serializer.startTag( NAMESPACE, "artifactId" ).text( parent.getArtifactId() ).endTag( NAMESPACE, "artifactId" );
  }
  if ( parent.getVersion() != null )
  {
    serializer.startTag( NAMESPACE, "version" ).text( parent.getVersion() ).endTag( NAMESPACE, "version" );
  }
  if ( ( parent.getRelativePath() != null ) && !parent.getRelativePath().equals( "../pom.xml" ) )
  {
    serializer.startTag( NAMESPACE, "relativePath" ).text( parent.getRelativePath() ).endTag( NAMESPACE, "relativePath" );
  }
  serializer.endTag( NAMESPACE, tagName );
} //-- void writeParent( Parent, String, XmlSerializer )

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

else if ( StringUtils.isEmpty( parentModel.getArtifactId() ) )
  parentModel.getArtifactId().equals( model.getArtifactId() ) )
  createCacheKey( parentModel.getGroupId(), parentModel.getArtifactId(), parentModel.getVersion() );
MavenProject parentProject = (MavenProject) rawProjectCache.get( parentKey );
      parentModel.getArtifactId().equals( candidateParent.getArtifactId() ) &&
      parentModel.getVersion().equals( candidateParentVersion ) )
                              parentModel.getArtifactId(),
                              parentModel.getVersion() );

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

String artifactId = parent.getArtifactId();
String version = parent.getVersion();

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

private void writeParent() throws IOException {
  Parent parent = model.getParent();
  if (parent != null) {
    out.write("        parent(" + br);
    out.write("            groupId -> \"" + parent.getGroupId() + "\"," + br);
    out.write("            artifactId -> \"" + parent.getArtifactId() + "\"");
    if (parent.getVersion() != null) {
      out.write("," + br);
      out.write("            version -> \"" + parent.getVersion()+ "\"");
    }
    if (parent.getRelativePath() != null) {
      out.write("," + br);
      out.write("            relativePath -> \"" + parent.getRelativePath()+ "\"" + br);
    }
    out.write("        );" + br);
  }
  
  writeProperties();
}

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

parent );
validateStringNotEmpty( "parent.artifactId", problems, Severity.FATAL, Version.BASE, parent.getArtifactId(),
            parent );
            parent );
if ( equals( parent.getGroupId(), m.getGroupId() ) && equals( parent.getArtifactId(), m.getArtifactId() ) )

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

private void parent(PrintWriter pw, Model model) {
  if (model.getParent() != null) {
   pw.print(indent + "inherits: " + model.getParent().getGroupId() + ":" + model.getParent().getArtifactId() + ":" + model.getParent().getVersion());
   if (model.getParent().getRelativePath() != null) {
    //pw.println(":" + model.getParent().getRelativePath());
//        pw.println(":" + "../pom.atom");
   }
   pw.println();
  }
 }

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

void parent(Parent parent) {
  if (parent != null) {
    p.print("inherit", parent.getGroupId() + ":"
        + parent.getArtifactId() + ":" + parent.getVersion());
    if (parent.getRelativePath() != null ) {
      if ( parent.getRelativePath().equals( "../pom.xml" ) ) {
        //p.append( ", '" ).append( "../pom.rb" ).append( "'" );
        p.println();
      }
      else {
        p.append(", '" + parent.getRelativePath() + "'").println();
      }
    }
    else {
      p.println();
    }
  }
}

代码示例来源:origin: INRIA/spoon

return model.getArtifactId();
} else if (model.getParent() != null) {
  return model.getParent().getArtifactId();

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

/**
 * Method writeParent.
 * 
 * @param parent
 * @param serializer
 * @param tagName
 * @throws java.io.IOException
 */
private void writeParent( Parent parent, String tagName, XmlSerializer serializer )
  throws java.io.IOException
{
  serializer.startTag( NAMESPACE, tagName );
  if ( parent.getGroupId() != null )
  {
    serializer.attribute( NAMESPACE, "groupId", parent.getGroupId() );
  }
  if ( parent.getArtifactId() != null )
  {
    serializer.attribute( NAMESPACE, "artifactId", parent.getArtifactId() );
  }
  if ( parent.getVersion() != null )
  {
    serializer.attribute( NAMESPACE, "version", parent.getVersion() );
  }
  if ( ( parent.getRelativePath() != null ) && !parent.getRelativePath().equals( "../pom.xml" ) )
  {
    serializer.attribute( NAMESPACE, "relativePath", parent.getRelativePath() );
  }
  serializer.endTag( NAMESPACE, tagName );
} //-- void writeParent( Parent, String, XmlSerializer )

代码示例来源:origin: org.onehippo.cms7.essentials/hippo-essentials-plugin-api-implementation

public static boolean isEnterpriseProject() {
  final Model pomModel = ProjectUtils.getPomModel(TargetPom.PROJECT);
  final Parent parent = pomModel.getParent();
  if (parent == null) {
    return false;
  }
  final String groupId = parent.getGroupId();
  final String artifactId = parent.getArtifactId();
  return groupId.equals(ProjectUtils.ENT_GROUP_ID) && artifactId.equals(ProjectUtils.ENT_ARTIFACT_ID);
}

代码示例来源:origin: org.codehaus.mojo/versions-maven-plugin

protected Artifact toArtifact( Parent model )
  throws MojoExecutionException
{
  Dependency d = new Dependency();
  d.setArtifactId( model.getArtifactId() );
  d.setGroupId( model.getGroupId() );
  d.setVersion( model.getVersion() );
  d.setType( "pom" );
  d.setScope( Artifact.SCOPE_COMPILE );
  return this.toArtifact( d );
}

相关文章