org.apache.maven.artifact.Artifact.getVersionRange()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(144)

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

Artifact.getVersionRange介绍

暂无

代码示例

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

public VersionRange getVersionRange()
{
  return parent.getVersionRange();
}

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

/** {@inheritDoc} */
public VersionRange getVersionRange()
{
  return artifact.getVersionRange();
}

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

/** {@inheritDoc} */
public VersionRange getVersionRange()
{
  return artifact.getVersionRange();
}

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

public VersionRange getVersionRange()
{
  return parent.getVersionRange();
}

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

public void restrictRange( Artifact artifact, Artifact replacement, VersionRange newRange )
{
  logger.debug( indent + artifact + " (range restricted from: " + artifact.getVersionRange() + " and: "
    + replacement.getVersionRange() + " to: " + newRange + " )" );
}

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

public void selectVersionFromRange( Artifact artifact )
{
  logger.debug( indent + artifact + " (setting version to: " + artifact.getVersion() + " from range: "
    + artifact.getVersionRange() + ")" );
}

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

public AttachedArtifact( Artifact parent, String type, String classifier, ArtifactHandler artifactHandler )
{        
  super( parent.getGroupId(), parent.getArtifactId(), parent.getVersionRange(), parent.getScope(), type,
      classifier, artifactHandler, parent.isOptional() );
  
  setDependencyTrail( Collections.singletonList( parent.getId() ) );
  
  this.parent = parent;
  
  if ( getId().equals( parent.getId() ) )
  {
    throw new InvalidArtifactRTException( parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), parent.getType(), "An attached artifact must have a different ID than its corresponding main artifact." );
  }
}

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

public AttachedArtifact( Artifact parent, String type, String classifier, ArtifactHandler artifactHandler )
{
  super( parent.getGroupId(), parent.getArtifactId(), parent.getVersionRange(), parent.getScope(), type,
      classifier, artifactHandler, parent.isOptional() );
  setDependencyTrail( Collections.singletonList( parent.getId() ) );
  this.parent = parent;
  if ( getId().equals( parent.getId() ) )
  {
    throw new InvalidArtifactRTException( parent.getGroupId(), parent.getArtifactId(), parent.getVersion(),
                       parent.getType(), "An attached artifact must have a different ID"
                         + " than its corresponding main artifact." );
  }
}

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

public static Artifact toArtifact( org.apache.maven.artifact.Artifact artifact )
{
  if ( artifact == null )
  {
    return null;
  }
  String version = artifact.getVersion();
  if ( version == null && artifact.getVersionRange() != null )
  {
    version = artifact.getVersionRange().toString();
  }
  Map<String, String> props = null;
  if ( org.apache.maven.artifact.Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) )
  {
    String localPath = ( artifact.getFile() != null ) ? artifact.getFile().getPath() : "";
    props = Collections.singletonMap( ArtifactProperties.LOCAL_PATH, localPath );
  }
  Artifact result =
    new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getClassifier(),
               artifact.getArtifactHandler().getExtension(), version, props,
               newArtifactType( artifact.getType(), artifact.getArtifactHandler() ) );
  result = result.setFile( artifact.getFile() );
  return result;
}

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

public int getNature()
{
  if ( artifact.getVersion() != null )
  {
    return artifact.isSnapshot() ? SNAPSHOT : RELEASE;
  }
  VersionRange range = artifact.getVersionRange();
  if ( range != null )
  {
    for ( Restriction restriction : range.getRestrictions() )
    {
      if ( isSnapshot( restriction.getLowerBound() ) || isSnapshot( restriction.getUpperBound() ) )
      {
        return RELEASE_OR_SNAPSHOT;
      }
    }
  }
  return RELEASE;
}

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

public static Artifact copyArtifact( Artifact artifact )
  VersionRange range = artifact.getVersionRange();

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

public static Artifact copyArtifact( Artifact artifact )
  VersionRange range = artifact.getVersionRange();

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

VersionRange previousRange = previous.getArtifact().getVersionRange();
VersionRange currentRange = node.getArtifact().getVersionRange();
    if ( resetArtifact.getVersion() == null && resetArtifact.getVersionRange() != null )
      ArtifactVersion selectedVersion = resetArtifact.getVersionRange().
        matchVersion( resetArtifact.getAvailableVersions() );
            + " to match the range " + resetArtifact.getVersionRange(),
          resetArtifact );
        VersionRange versionRange = artifact.getVersionRange();

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

break;
case ResolutionListener.RESTRICT_RANGE:
  if ( node.getArtifact().getVersionRange().hasRestrictions()
       || replacement.getVersionRange().hasRestrictions() )

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

public void restrictRange( Artifact artifact, Artifact replacement, VersionRange newRange )
{
  project.log( indent + artifact + " (range restricted from: " + artifact.getVersionRange() + " and: " +
    replacement.getVersionRange() + " to: " + newRange + " )" );
}

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

public void restrictRange( Artifact artifact, Artifact replacement, VersionRange newRange )
{
  project.log( indent + artifact + " (range restricted from: " + artifact.getVersionRange() + " and: "
         + replacement.getVersionRange() + " to: " + newRange + " )", Project.MSG_VERBOSE );
}

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

public void selectVersionFromRange( Artifact artifact )
{
  project.log( indent + artifact + " (setting version to: " + artifact.getVersion() + " from range: "
         + artifact.getVersionRange() + ")", Project.MSG_VERBOSE );
}

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

public void selectVersionFromRange( Artifact artifact )
{
  project.log( indent + artifact + " (setting version to: " + artifact.getVersion() + " from range: " +
    artifact.getVersionRange() + ")" );
}

代码示例来源:origin: maven-nar/nar-maven-plugin

public NarArtifact(final Artifact dependency, final NarInfo narInfo) {
 super(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersionRange(), dependency.getScope(),
   dependency.getType(), dependency.getClassifier(), dependency.getArtifactHandler(), dependency.isOptional());
 this.setFile(dependency.getFile());
 this.narInfo = narInfo;
}

代码示例来源:origin: maven-nar/nar-maven-plugin

public AttachedNarArtifact(final Artifact parent, final String type, final String classifier) {
 super(parent.getGroupId(), parent.getArtifactId(), parent.getVersionRange(), parent.getScope(), type, classifier,
   null, parent.isOptional());
 setArtifactHandler(new Handler(classifier));
}

相关文章

微信公众号

最新文章

更多