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


Java DefaultArtifactHandler.setExtension方法代码示例

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


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

示例1: getModelArtifact

import org.apache.maven.artifact.handler.DefaultArtifactHandler; //导入方法依赖的package包/类
/**
 * Generate an model Artifact
 *
 * @param groupId String
 * @param artifactId String
 * @param version String
 * @return Artifact
 */
private Artifact getModelArtifact(final String groupId, final String artifactId, final String version ){
    final DefaultArtifactHandler handler = new DefaultArtifactHandler();
    handler.setExtension("pom");

    final Artifact model = new DefaultArtifact(
            groupId,
            artifactId,
            version,
            null,
            "pom",
            null ,
            handler);

    return model;

}
 
开发者ID:Axway,项目名称:grapes-maven-plugin,代码行数:25,代码来源:LicenseResolver.java

示例2: newHandler

import org.apache.maven.artifact.handler.DefaultArtifactHandler; //导入方法依赖的package包/类
private static ArtifactHandler newHandler(String type, String path) {
  final String extension = (path == null) ? "" : FileUtils.extension(path);
  if(isBlank(type)) {
    type = extension;
  }
  DefaultArtifactHandler handler = new DefaultArtifactHandler(type);
  if(! isBlank(extension)) {
    handler.setExtension(extension);
  }
  return handler;
}
 
开发者ID:mjiderhamn,项目名称:promote-maven-plugin,代码行数:12,代码来源:PromoteUtils.java

示例3: resolveArtifact

import org.apache.maven.artifact.handler.DefaultArtifactHandler; //导入方法依赖的package包/类
/**
 * Resolve a dependency artifact
 *
 * @param project MavenProject
 * @param dependency dependency
 * @return Artifact
 */
public Artifact resolveArtifact(final MavenProject project, final Dependency dependency) throws MojoExecutionException {
    // Manage version ranges
    String version = dependency.getVersion();
    try{
        if(!version.matches("[0-9.]*")){
            final VersionRange range = VersionRange.createFromVersionSpec(version);
            version = getArtifactVersion(range);
        }
    }
    catch (InvalidVersionSpecificationException e){
        throw new MojoExecutionException("Failed to handle version range of " + dependency.toString(), e);
    }

    final DefaultArtifactHandler handler = new DefaultArtifactHandler();
    handler.setExtension(dependency.getType());

    final Artifact artifact = new DefaultArtifact(
            dependency.getGroupId(),
            dependency.getArtifactId(),
            version,
            null,
            dependency.getType(),
            dependency.getClassifier() ,
            handler);

    resolveArtifact(project, artifact);

    return artifact;
}
 
开发者ID:Axway,项目名称:grapes-maven-plugin,代码行数:37,代码来源:ArtifactResolver.java

示例4: generateDependency

import org.apache.maven.artifact.handler.DefaultArtifactHandler; //导入方法依赖的package包/类
@Test
public void generateDependency() throws MojoExecutionException {
    final String groupId = "org.axway.grapes.test" ;
    final String artifactId = "artifactId" ;
    final String version = "1.0.0" ;
    final String classifier = "linux" ;
    final String type = "test-jar" ;
    final String extension = "jar" ;
    final String scope = "TEST" ;

    final DefaultArtifactHandler handler = new DefaultArtifactHandler();
    handler.setExtension(extension);

    final org.apache.maven.artifact.Artifact mavenArtifact = new DefaultArtifact(
            groupId,
            artifactId,
            version,
            "COMPILE",
            type,
            classifier ,
            handler);

    final Dependency dependency = GrapesTranslator.getGrapesDependency(mavenArtifact, scope);
    assertEquals(groupId, dependency.getTarget().getGroupId());
    assertEquals(artifactId, dependency.getTarget().getArtifactId());
    assertEquals(classifier, dependency.getTarget().getClassifier());
    assertEquals(version, dependency.getTarget().getVersion());
    assertEquals(type, dependency.getTarget().getType());
    assertEquals(extension, dependency.getTarget().getExtension());
    assertEquals(scope, dependency.getScope().toString());

}
 
开发者ID:Axway,项目名称:grapes-maven-plugin,代码行数:33,代码来源:GrapesTranslatorTest.java

示例5: newHandler

import org.apache.maven.artifact.handler.DefaultArtifactHandler; //导入方法依赖的package包/类
public static ArtifactHandler newHandler(Artifact artifact) {
  String type = artifact.getProperty(ArtifactProperties.TYPE, artifact.getExtension());
  DefaultArtifactHandler handler = new DefaultArtifactHandler(type);
  handler.setExtension(artifact.getExtension());
  handler.setLanguage(artifact.getProperty(ArtifactProperties.LANGUAGE, null));
  handler.setAddedToClasspath(Boolean.parseBoolean(artifact.getProperty(ArtifactProperties.CONSTITUTES_BUILD_PATH, "")));
  handler.setIncludesDependencies(Boolean.parseBoolean(artifact.getProperty(ArtifactProperties.INCLUDES_DEPENDENCIES, "")));
  return handler;
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:10,代码来源:AetherUtils.java

示例6: newHandler

import org.apache.maven.artifact.handler.DefaultArtifactHandler; //导入方法依赖的package包/类
public static ArtifactHandler newHandler( Artifact artifact )
{
    String type = artifact.getProperty( ArtifactProperties.TYPE, artifact.getExtension() );
    DefaultArtifactHandler handler = new DefaultArtifactHandler( type );
    handler.setExtension( artifact.getExtension() );
    handler.setLanguage( artifact.getProperty( ArtifactProperties.LANGUAGE, null ) );
    handler.setAddedToClasspath( Boolean.parseBoolean( artifact.getProperty( ArtifactProperties.CONSTITUTES_BUILD_PATH,
                                                                             "" ) ) );
    handler.setIncludesDependencies( Boolean.parseBoolean( artifact.getProperty( ArtifactProperties.INCLUDES_DEPENDENCIES,
                                                                                 "" ) ) );
    return handler;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:13,代码来源:RepositoryUtils.java

示例7: newHandler

import org.apache.maven.artifact.handler.DefaultArtifactHandler; //导入方法依赖的package包/类
public static ArtifactHandler newHandler(Artifact artifact) {
    String ext = "jar";
    String type = "bundle";
    DefaultArtifactHandler handler = new DefaultArtifactHandler(type);
    handler.setExtension(ext);
    handler.setLanguage("java");
    handler.setAddedToClasspath(true);
    handler.setIncludesDependencies(true);
    return handler;
}
 
开发者ID:tonit,项目名称:pax-bnd-mavenplugin,代码行数:11,代码来源:BuildpathhMojo.java


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