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

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

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

Extension.setVersion介绍

[英]Set the version of the extension.
[中]设置扩展的版本。

代码示例

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

protected void mergeExtension_Version( Extension target, Extension source, boolean sourceDominant,
                    Map<Object, Object> context )
{
  String src = source.getVersion();
  if ( src != null )
  {
    if ( sourceDominant || target.getVersion() == null )
    {
      target.setVersion( src );
      target.setLocation( "version", source.getLocation( "version" ) );
    }
  }
}

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

public static Extension cloneExtension( Extension src )
{
  Extension rExt = new Extension();
  rExt.setArtifactId( src.getArtifactId() );
  rExt.setGroupId( src.getGroupId() );
  rExt.setVersion( src.getVersion() );
  
  return rExt;
}

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

extension.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );

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

public Extension mergeExtension(Extension extension) {
 extension.setGroupId(groupId);
 extension.setArtifactId(artifactId);
 if(version != null) extension.setVersion(version);
 return extension;
}

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

extension.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );

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

public default Extension extension(String classifier) {
  Extension extension = new Extension();
  
  String[] parts = classifier.split(":");
  if (parts.length == 2) {
    extension.setGroupId(parts[0]);
    extension.setArtifactId(parts[1]);
  } else if (parts.length == 3) {
    extension.setVersion(parts[2]);
  }
  return extension;
}

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

public default Extension extension(String groupId, String artifactId, String version) {
  Extension extension = new Extension();
  extension.setGroupId(groupId);
  extension.setArtifactId(artifactId);
  extension.setVersion(version);
  return extension;
}

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

public static Extension parse(final Object value) {
  assert value != null;

  if (value instanceof String) {
   Extension node = new Extension();
   String[] items = ((String) value).split(":");
   switch (items.length) {
   case 2:
    node.setGroupId(items[0]);
    node.setArtifactId(items[1]);
    return node;
   case 3:
    node.setGroupId(items[0]);
    node.setArtifactId(items[1]);
    node.setVersion(items[2]);
    return node;
   }
  }

  return null;
 }
}

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

extension.setVersion( getTrimmedValue( value ) );

代码示例来源:origin: io.takari.polyglot/polyglot-yaml

public Extension mergeExtension(Extension extension) {
 extension.setGroupId(groupId);
 extension.setArtifactId(artifactId);
 if(version != null) extension.setVersion(version);
 return extension;
}

代码示例来源:origin: io.tesla.maven/maven-model

protected void mergeExtension_Version( Extension target, Extension source, boolean sourceDominant,
                    Map<Object, Object> context )
{
  String src = source.getVersion();
  if ( src != null )
  {
    if ( sourceDominant || target.getVersion() == null )
    {
      target.setVersion( src );
      target.setLocation( "version", source.getLocation( "version" ) );
    }
  }
}

代码示例来源:origin: io.takari.polyglot/polyglot-groovy

public static Extension parse(final Object value) {
  assert value != null;

  if (value instanceof String) {
   Extension node = new Extension();
   String[] items = ((String) value).split(":");
   switch (items.length) {
   case 2:
    node.setGroupId(items[0]);
    node.setArtifactId(items[1]);
    return node;
   case 3:
    node.setGroupId(items[0]);
    node.setArtifactId(items[1]);
    node.setVersion(items[2]);
    return node;
   }
  }

  return null;
 }
}

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

private List<Extension> createReleaseExtensions( ReleaseDescriptor releaseDescriptor,
                         MavenProject project )
  throws ReleaseFailureException
{
  List<Extension> releaseExtensions = null;
  // Use original - don't want the lifecycle introduced ones
  Build build = project.getOriginalModel().getBuild();
  if ( build != null )
  {
    List<Extension> extensions = build.getExtensions();
    if ( extensions != null )
    {
      releaseExtensions = new ArrayList<>();
      for ( Extension extension : extensions )
      {
        String id = ArtifactUtils.versionlessKey( extension.getGroupId(), extension.getArtifactId() );
        Artifact artifact = project.getExtensionArtifactMap().get( id );
        String version = getReleaseVersion( releaseDescriptor, artifact );
        Extension releaseExtension = new Extension();
        releaseExtension.setGroupId( extension.getGroupId() );
        releaseExtension.setArtifactId( extension.getArtifactId() );
        releaseExtension.setVersion( version );
        releaseExtensions.add( releaseExtension );
      }
    }
  }
  return releaseExtensions;
}

代码示例来源:origin: com.github.htfv.maven.plugins/build-configurator-core

/**
 * Interpolates elements of the {@link Extension} object.
 *
 * @param extension
 *            {@link Extension} object whose elements to interpolate.
 */
private void interpolateExtension(final Extension extension)
{
  extension.setArtifactId(
      interpolateString(extension.getArtifactId()));
  extension.setGroupId(
      interpolateString(extension.getGroupId()));
  extension.setVersion(
      interpolateString(extension.getVersion()));
}

代码示例来源:origin: org.sonatype.maven.archetype/archetype-common

extension.setGroupId("org.sonatype.maven.archetype");
extension.setArtifactId("archetype-packaging");
extension.setVersion(getArchetypeVersion());
model.getBuild().addExtension(extension);

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

extension.setGroupId( "org.apache.maven.archetype" );
extension.setArtifactId( "archetype-packaging" );
extension.setVersion( getArchetypeVersion() );
model.getBuild().addExtension( extension );

代码示例来源:origin: io.tesla.maven/maven-model

extension.setVersion( getTrimmedValue( parser.nextText() ) );

代码示例来源:origin: io.fabric8.forge/devops

extension.setGroupId(EXTENSION_DAV_GROUP_ID);
extension.setArtifactId(EXTENSION_DAV_ARTIFACT_ID);
extension.setVersion(EXTENSION_DAV_VERSION);
extensions.add(extension);
build.setExtensions(extensions);

代码示例来源:origin: io.tesla.maven/maven-model

extension.setVersion( getTrimmedValue( parser.nextText() ) );

相关文章