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


Java InvalidArtifactRTException类代码示例

本文整理汇总了Java中org.apache.maven.artifact.InvalidArtifactRTException的典型用法代码示例。如果您正苦于以下问题:Java InvalidArtifactRTException类的具体用法?Java InvalidArtifactRTException怎么用?Java InvalidArtifactRTException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: populateArtifactInfo

import org.apache.maven.artifact.InvalidArtifactRTException; //导入依赖的package包/类
@Override public void populateArtifactInfo(ArtifactContext context) throws IOException {
    ArtifactInfo ai = context.getArtifactInfo();
    if (ai.getClassifier() != null) {
        return;
    }
    try {
        MavenProject mp = load(ai);
        if (mp != null) {
            List<Dependency> dependencies = mp.getDependencies();
            LOG.log(Level.FINER, "Successfully loaded project model from repository for {0} with {1} dependencies", new Object[] {ai, dependencies.size()});
            dependenciesByArtifact.put(ai, dependencies);
        }
    } catch (InvalidArtifactRTException ex) {
        ex.printStackTrace();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ArtifactDependencyIndexCreator.java

示例2: AttachedArtifact

import org.apache.maven.artifact.InvalidArtifactRTException; //导入依赖的package包/类
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." );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:17,代码来源:AttachedArtifact.java

示例3: forPOM

import org.apache.maven.artifact.InvalidArtifactRTException; //导入依赖的package包/类
@MultiViewElement.Registration(
    displayName="#TAB_Graph",
    iconBase=IconResources.ICON_DEPENDENCY_JAR,
    persistenceType=TopComponent.PERSISTENCE_NEVER,
    preferredID=ArtifactViewer.HINT_GRAPH,
    mimeType=Constants.POM_MIME_TYPE,
    position=100
)
@Messages("TAB_Graph=Graph")
public static MultiViewElement forPOM(final Lookup editor) {
    class L extends ProxyLookup implements PropertyChangeListener {
        Project p;
        L() {
            FileObject pom = editor.lookup(FileObject.class);
            if (pom != null) {
                p = FileOwnerQuery.getOwner(pom);
                if (p != null) {
                    NbMavenProject nbmp = p.getLookup().lookup(NbMavenProject.class);
                    if (nbmp != null) {
                        nbmp.addPropertyChangeListener(WeakListeners.propertyChange(this, nbmp));
                        reset();
                    } else {
                        LOG.log(Level.WARNING, "not a Maven project: {0}", p);
                    }
                } else {
                    LOG.log(Level.WARNING, "no owner of {0}", pom);
                }
            } else {
                LOG.log(Level.WARNING, "no FileObject in {0}", editor);
            }
        }
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (NbMavenProject.PROP_PROJECT.equals(evt.getPropertyName())) {
                reset();
            }
        }
        private void reset() {
            ArtifactViewerFactory avf = Lookup.getDefault().lookup(ArtifactViewerFactory.class);
            if (avf != null) {
                Lookup l = null;
                try {
                    l = avf.createLookup(p);
                } catch (InvalidArtifactRTException e) {
                    // issue #258898 
                    LOG.log(Level.WARNING, "problems while creating lookup for {"  + p + "} : " + e.getMessage(), e);
                }
                if (l != null) {
                    setLookups(l);
                } else {
                    LOG.log(Level.WARNING, "no artifact lookup for {0}", p);
                }
            } else {
                LOG.warning("no ArtifactViewerFactory found");
            }
        }
    }
    return new DependencyGraphTopComponent(new L());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:60,代码来源:DependencyGraphTopComponent.java


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