当前位置: 首页>>代码示例>>Java>>正文


Java ArtifactHandler.getExtension方法代码示例

本文整理汇总了Java中org.apache.maven.artifact.handler.ArtifactHandler.getExtension方法的典型用法代码示例。如果您正苦于以下问题:Java ArtifactHandler.getExtension方法的具体用法?Java ArtifactHandler.getExtension怎么用?Java ArtifactHandler.getExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.maven.artifact.handler.ArtifactHandler的用法示例。


在下文中一共展示了ArtifactHandler.getExtension方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: pathOf

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
@Override
public String pathOf( Artifact artifact )
{
    ArtifactHandler artifactHandler = artifact.getArtifactHandler();

    StringBuilder path = new StringBuilder( 128 );

    path.append( artifact.getGroupId() ).append( '/' );
    path.append( artifactHandler.getDirectory() ).append( '/' );
    path.append( artifact.getArtifactId() ).append( '-' ).append( artifact.getVersion() );

    if ( artifact.hasClassifier() )
    {
        path.append( '-' ).append( artifact.getClassifier() );
    }

    if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 )
    {
        path.append( '.' ).append( artifactHandler.getExtension() );
    }

    return path.toString();
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:24,代码来源:LegacyRepositoryLayout.java

示例2: pathOf

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
public String pathOf( Artifact artifact )
{
    ArtifactHandler artifactHandler = artifact.getArtifactHandler();

    StringBuffer path = new StringBuffer();

    path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() );

    if ( artifact.hasClassifier() )
    {
        path.append( ARTIFACT_SEPARATOR ).append( artifact.getClassifier() );
    }

    if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 )
    {
        path.append( GROUP_SEPARATOR ).append( artifactHandler.getExtension() );
    }

    return path.toString();
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:21,代码来源:FlatRepositoryLayout.java

示例3: pathOf

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
public String pathOf( Artifact artifact )
{
    ArtifactHandler artifactHandler = artifact.getArtifactHandler();

    StringBuilder path = new StringBuilder();

    path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() );

    if ( artifact.hasClassifier() )
    {
        path.append( ARTIFACT_SEPARATOR ).append( artifact.getClassifier() );
    }

    if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 )
    {
        path.append( GROUP_SEPARATOR ).append( artifactHandler.getExtension() );
    }

    return path.toString();
}
 
开发者ID:mojohaus,项目名称:appassembler,代码行数:21,代码来源:FlatRepositoryLayout.java

示例4: pathOf

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
public String pathOf( Artifact artifact )
{
    ArtifactHandler artifactHandler = artifact.getArtifactHandler();

    StringBuilder path = new StringBuilder( 128 );

    path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() );

    if ( artifact.hasClassifier() )
    {
        path.append( ARTIFACT_SEPARATOR ).append( artifact.getClassifier() );
    }

    if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 )
    {
        path.append( GROUP_SEPARATOR ).append( artifactHandler.getExtension() );
    }

    return path.toString();
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:21,代码来源:FlatRepositoryLayout.java

示例5: pathOf

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
public String pathOf( Artifact artifact )
{
    ArtifactHandler artifactHandler = artifact.getArtifactHandler();

    StringBuilder path = new StringBuilder( 128 );

    path.append( artifact.getGroupId() ).append( '/' );
    path.append( artifactHandler.getDirectory() ).append( '/' );
    path.append( artifact.getArtifactId() ).append( '-' ).append( artifact.getVersion() );

    if ( artifact.hasClassifier() )
    {
        path.append( '-' ).append( artifact.getClassifier() );
    }

    if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 )
    {
        path.append( '.' ).append( artifactHandler.getExtension() );
    }

    return path.toString();
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:23,代码来源:LegacyRepositoryLayout.java

示例6: pathOf

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
public String pathOf( Artifact artifact )
{
    ArtifactHandler artifactHandler = artifact.getArtifactHandler();

    StringBuilder path = new StringBuilder( 128 );

    path.append( formatAsDirectory( artifact.getGroupId() ) ).append( PATH_SEPARATOR );
    path.append( artifact.getArtifactId() ).append( PATH_SEPARATOR );
    path.append( artifact.getBaseVersion() ).append( PATH_SEPARATOR );
    path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() );

    if ( artifact.hasClassifier() )
    {
        path.append( ARTIFACT_SEPARATOR ).append( artifact.getClassifier() );
    }

    if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 )
    {
        path.append( GROUP_SEPARATOR ).append( artifactHandler.getExtension() );
    }

    return path.toString();
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:24,代码来源:DefaultRepositoryLayout.java

示例7: pathBaseVersionOf

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
/**
 * get relative path the copied artifact using base version. This is mainly use to SNAPSHOT instead of timestamp in
 * the file name
 * 
 * @param artifactRepositoryLayout
 * @param artifact
 * @return
 */
public static String pathBaseVersionOf( ArtifactRepositoryLayout artifactRepositoryLayout, Artifact artifact )
{
    ArtifactHandler artifactHandler = artifact.getArtifactHandler();

    StringBuffer fileName = new StringBuffer();

    fileName.append( artifact.getArtifactId() ).append( "-" ).append( artifact.getBaseVersion() );

    if ( artifact.hasClassifier() )
    {
        fileName.append( "-" ).append( artifact.getClassifier() );
    }

    if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 )
    {
        fileName.append( "." ).append( artifactHandler.getExtension() );
    }

    String relativePath = artifactRepositoryLayout.pathOf( artifact );
    String[] tokens = StringUtils.split( relativePath, "/" );
    tokens[tokens.length - 1] = fileName.toString();

    StringBuffer path = new StringBuffer();

    for ( int i = 0; i < tokens.length; ++i )
    {

        path.append( tokens[i] );
        if ( i != tokens.length - 1 )
        {
            path.append( "/" );
        }
    }

    return path.toString();

}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:46,代码来源:ArtifactUtils.java

示例8: newElement

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
public Xpp3Dom newElement(@Nonnull String name, @Nullable Artifact artifact) {
    Xpp3Dom element = new Xpp3Dom(name);
    if (artifact == null) {
        return element;
    }

    element.setAttribute("groupId", artifact.getGroupId());
    element.setAttribute("artifactId", artifact.getArtifactId());
    element.setAttribute("baseVersion", artifact.getBaseVersion());
    element.setAttribute("version", artifact.getVersion());
    element.setAttribute("snapshot", String.valueOf(artifact.isSnapshot()));
    if (artifact.getClassifier() != null) {
        element.setAttribute("classifier", artifact.getClassifier());
    }
    element.setAttribute("type", artifact.getType());
    element.setAttribute("id", artifact.getId());

    ArtifactHandler artifactHandler = artifact.getArtifactHandler();
    String extension;
    if (artifactHandler == null) {
        extension = artifact.getType();
    } else {
        extension = artifactHandler.getExtension();
    }
    element.setAttribute("extension", extension);

    return element;
}
 
开发者ID:jenkinsci,项目名称:pipeline-maven-plugin,代码行数:29,代码来源:AbstractMavenEventHandler.java

示例9: convertExtension

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
private static String convertExtension(Artifact artifact) {
  ArtifactHandler handler = artifact.getArtifactHandler();
  String result = null;
  if (handler != null) result = handler.getExtension();
  if (result == null) result = artifact.getType();
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:MavenModelConverter.java

示例10: convertExtension

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
private static String convertExtension(Artifact artifact) {
  ArtifactHandler artifactHandler = artifact.getArtifactHandler();
  String result = null;

  if (artifactHandler != null) {
    result = artifactHandler.getExtension();
  }

  if (result == null) {
    result = artifact.getType();
  }
  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:MavenModelUtil.java

示例11: pathBaseVersionOf

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
/**
 * get relative path the copied artifact using base version. This is mainly use to SNAPSHOT instead of timestamp in
 * the file name
 *
 * @param artifactRepositoryLayout
 * @param artifact
 * @return
 */
public static String pathBaseVersionOf( ArtifactRepositoryLayout artifactRepositoryLayout, Artifact artifact )
{
    ArtifactHandler artifactHandler = artifact.getArtifactHandler();

    StringBuilder fileName = new StringBuilder();

    fileName.append( artifact.getArtifactId() ).append( "-" ).append( artifact.getBaseVersion() );

    if ( artifact.hasClassifier() )
    {
        fileName.append( "-" ).append( artifact.getClassifier() );
    }

    if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 )
    {
        fileName.append( "." ).append( artifactHandler.getExtension() );
    }

    String relativePath = artifactRepositoryLayout.pathOf( artifact );
    String[] tokens = StringUtils.split( relativePath, "/" );
    tokens[tokens.length - 1] = fileName.toString();

    StringBuilder path = new StringBuilder();

    for ( int i = 0; i < tokens.length; ++i )
    {

        path.append( tokens[i] );
        if ( i != tokens.length - 1 )
        {
            path.append( "/" );
        }
    }

    return path.toString();

}
 
开发者ID:mojohaus,项目名称:appassembler,代码行数:46,代码来源:ArtifactUtils.java

示例12: excludesDependencies

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
/**
 * Creates a new ArtifactHandler for the specified Artifact that overrides the includeDependencies flag. When set, this flag prevents transitive
 * dependencies from being printed in dependencies plugin.
 *
 * @param artifact  The artifact
 * @return          The handler for the artifact
 */
private ArtifactHandler excludesDependencies(final Artifact artifact) {
    final ArtifactHandler orig = artifact.getArtifactHandler();

    return new ArtifactHandler() {
        @Override
        public String getExtension() {
            return orig.getExtension();
        }

        @Override
        public String getDirectory() {
            return orig.getDirectory();
        }

        @Override
        public String getClassifier() {
            return orig.getClassifier();
        }

        @Override
        public String getPackaging() {
            return orig.getPackaging();
        }

        // mark dependencies has excluded so they will appear in tree listing
        @Override
        public boolean isIncludesDependencies() {
            return false;
        }

        @Override
        public String getLanguage() {
            return orig.getLanguage();
        }

        @Override
        public boolean isAddedToClasspath() {
            return orig.isAddedToClasspath();
        }
    };
}
 
开发者ID:apache,项目名称:nifi-maven,代码行数:49,代码来源:NarProvidedDependenciesMojo.java

示例13: newArtifactType

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
public static ArtifactType newArtifactType(String id, ArtifactHandler handler) {
  return new DefaultArtifactType(id, handler.getExtension(), handler.getClassifier(), handler.getLanguage(), handler.isAddedToClasspath(), handler.isIncludesDependencies());
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:4,代码来源:AetherUtils.java

示例14: newArtifactType

import org.apache.maven.artifact.handler.ArtifactHandler; //导入方法依赖的package包/类
public static ArtifactType newArtifactType( String id, ArtifactHandler handler )
{
    return new DefaultArtifactType( id, handler.getExtension(), handler.getClassifier(), handler.getLanguage(),
                                    handler.isAddedToClasspath(), handler.isIncludesDependencies() );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:6,代码来源:RepositoryUtils.java


注:本文中的org.apache.maven.artifact.handler.ArtifactHandler.getExtension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。