【问题标题】:How to use aether to get the latest timestamped snapshot dependency?如何使用以太获取最新的时间戳快照依赖?
【发布时间】:2015-10-12 15:00:30
【问题描述】:

我正在使用以太来解决依赖关系。但是在快照依赖关系的情况下,同一版本有多个时间戳,它不会尊重时间戳,而是选择第一个可用的时间戳。如何使用以太读取时间戳?

我正在使用以下代码块来计算快照和发布版本

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.eclipse.aether:aether-impl:1.0.0.v20140518" );

    ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
    descriptorRequest.setArtifact( artifact );
    descriptorRequest.setRepositories( Booter.newRepositories( system, session ) );

    ArtifactDescriptorResult descriptorResult = system.readArtifactDescriptor( session, descriptorRequest );

    for ( Dependency dependency : descriptorResult.getDependencies() )
    {
        System.out.println( dependency );
    }
}

}

这是来自他们的文档https://github.com/eclipse/aether-demo/blob/master/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDirectDependencies.java

【问题讨论】:

  • 你的代码是什么样子的?您如何处理 SNAPSHOT 版本?

标签: maven timestamp snapshot aether


【解决方案1】:

我通过配置以下会话属性实现了这一点

aether.artifactResolver.snapshotNormalization=false

例子:

mvn -Daether.artifactResolver.snapshotNormalization=false  clean install

【讨论】:

  • 你是如何设置配置属性的?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-03
  • 1970-01-01
  • 1970-01-01
  • 2013-02-12
  • 2018-07-14
  • 2017-05-01
相关资源
最近更新 更多