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


Java Artifact.getArtifactId方法代码示例

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


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

示例1: constructRemoteURL

import org.eclipse.aether.artifact.Artifact; //导入方法依赖的package包/类
private URL constructRemoteURL(final Artifact artifact, final RemoteRepository repository) throws MalformedURLException {

        final StringBuilder url_as_string = new StringBuilder();
        final String artifact_id = artifact.getArtifactId();
        final String repo_url = repository.getUrl();
        url_as_string.append(repo_url.endsWith("/") ? repo_url : repo_url + "/");
        url_as_string.append(artifact.getGroupId().replaceAll("\\.", "/"));
        url_as_string.append("/");
        url_as_string.append(artifact_id);
        url_as_string.append("/");
        url_as_string.append(artifact.getBaseVersion());
        url_as_string.append("/");
        url_as_string.append(artifact_id);
        url_as_string.append("-");
        url_as_string.append(artifact.getVersion());
        url_as_string.append(".");
        url_as_string.append(artifact.getExtension());

        return new URL(url_as_string.toString());
    }
 
开发者ID:stacs-srg,项目名称:shabdiz,代码行数:21,代码来源:MavenDependencyResolver.java

示例2: findArtifact

import org.eclipse.aether.artifact.Artifact; //导入方法依赖的package包/类
@Override
public File findArtifact(Artifact artifact) {
    return super.findArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getBaseVersion(), artifact.getExtension(), artifact.getClassifier());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:IDEWorkspaceReader2.java

示例3: findVersions

import org.eclipse.aether.artifact.Artifact; //导入方法依赖的package包/类
@Override
public List<String> findVersions(Artifact artifact) {
    return super.findVersions(artifact.getGroupId(), artifact.getArtifactId());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:IDEWorkspaceReader2.java

示例4: resolve

import org.eclipse.aether.artifact.Artifact; //导入方法依赖的package包/类
public @Override File resolve(Artifact artifact) {
    if (!artifact.getExtension().equals(NbMavenProject.TYPE_POM)) {
        return null;
    }
    if (!artifact.getClassifier().isEmpty()) {
        return null;
    }
    ArtifactRepository local = EmbedderFactory.getProjectEmbedder().getLocalRepository();
    if (local.getLayout() != null) { // #189807: for unknown reasons, there is no layout when running inside MavenCommandLineExecutor.run
        
        //the special snapshot handling is important in case of SNAPSHOT or x-SNAPSHOT versions, for some reason aether has slightly different
        //handling of baseversion compared to maven artifact. we need to manually set the baseversion here..
        boolean isSnapshot = artifact.isSnapshot();
        DefaultArtifact art = new DefaultArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), null, artifact.getExtension(), artifact.getClassifier(), new DefaultArtifactHandler(artifact.getExtension()));
        if (isSnapshot) {
            art.setBaseVersion(artifact.getBaseVersion());
        }
        String path = local.pathOf(art);
        if (new File(local.getBasedir(), path).exists()) {
            return null; // for now, we prefer the repository version when available
        }
    }
    //#234586
    Set<String> gavSet = gav.get();
    if (gavSet == null) {
        gavSet = new HashSet<String>();
        gav.set(gavSet);
    }
    String id = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion();

    if (!gavSet.contains(id)) {
        try {
            gavSet.add(id); //#234586
            File pom = MavenFileOwnerQueryImpl.getInstance().getOwnerPOM(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion());
            if (pom != null) {
                //instead of workarounds down the road, we set the artifact's file here.
                // some stacktraces to maven/aether do set it after querying our code, but some don't for reasons unknown to me.
                artifact.setFile(pom);
                return pom;
            }
        } finally {
            gavSet.remove(id); //#234586
            if (gavSet.isEmpty()) {
                gav.remove();
            }
        }
    } else {
        LOG.log(Level.INFO, "Cycle in NbArtifactFixer resolution (issue #234586): {0}", Arrays.toString(gavSet.toArray()));
    }
    
    try {
        File f = createFallbackPOM(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion());
        //instead of workarounds down the road, we set the artifact's file here.
        // some stacktraces to maven/aether do set it after querying our code, but some don't for reasons unknown to me.
        artifact.setFile(f);
        return f;
    } catch (IOException x) {
        Exceptions.printStackTrace(x);
        return null;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:62,代码来源:NbArtifactFixer.java

示例5: FileBasedWarm

import org.eclipse.aether.artifact.Artifact; //导入方法依赖的package包/类
FileBasedWarm(Class<?> main_class, Artifact maven_artifact) {

            super(main_class);
            this.maven_artifact = maven_artifact;
            artifact_id = maven_artifact.getArtifactId();
        }
 
开发者ID:stacs-srg,项目名称:shabdiz,代码行数:7,代码来源:HelloWorldManager.java


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