本文整理匯總了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();
}
}
示例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." );
}
}
示例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());
}