1
이슈 계산을 위해 웹 주위에 많은 예제가 있습니다. transitive dependencies using Aether. 즉, 어떻게하면 유물을 즉 개의 종속성 (한 단계 깊숙이)으로 가져올 수 있습니까?Aether : 이물의 비 전이 의존성을 얻는 방법?
이슈 계산을 위해 웹 주위에 많은 예제가 있습니다. transitive dependencies using Aether. 즉, 어떻게하면 유물을 즉 개의 종속성 (한 단계 깊숙이)으로 가져올 수 있습니까?Aether : 이물의 비 전이 의존성을 얻는 방법?
내 자신의 질문에 대답 :
내가 http://git.eclipse.org/c/aether/aether-demo.git에서 가져온 "오드 데모 Snipplets"에서 GetDirectDependencies.java 발견:
어쨌든/*******************************************************************************
* Copyright (c) 2010, 2012 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Sonatype, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.aether.examples;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.examples.util.Booter;
import org.eclipse.aether.graph.Dependency;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactDescriptorRequest;
import org.eclipse.aether.resolution.ArtifactDescriptorResult;
/**
* Determines the direct dependencies of an artifact as declared in its artifact descriptor (POM).
*/
public class GetDirectDependencies
{
public static void main(String[] args)
throws Exception
{
System.out.println("------------------------------------------------------------");
System.out.println(GetDirectDependencies.class.getSimpleName());
RepositorySystem system = Booter.newRepositorySystem();
RepositorySystemSession session = Booter.newRepositorySystemSession(system);
Artifact artifact = new DefaultArtifact("org.sonatype.aether:aether-impl:1.13");
RemoteRepository repo = Booter.newCentralRepository();
ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
descriptorRequest.setArtifact(artifact);
descriptorRequest.addRepository(repo);
ArtifactDescriptorResult descriptorResult = system.readArtifactDescriptor(session, descriptorRequest);
for (Dependency dependency : descriptorResult.getDependencies())
{
System.out.println(dependency);
}
}
}
이들의 '해결'종속성을 얻을 수 있습니까? 이것으로 지역 repo에 항아리를 다운로드합니까? –