如何使用以太获取最新的带时间戳的快照依赖?
How to use aether to get the latest timestamped snapshot dependency?
我正在使用以太来解决依赖关系。但是,如果快照依赖项的同一版本有多个时间戳,则它不会遵守时间戳,而是选择第一个可用的时间戳。如何使用以太读取时间戳?
我正在使用以下代码块来计算快照和发布版本
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 );
}
}
}
我通过配置以下会话实现了这一点 属性
aether.artifactResolver.snapshotNormalization=false
示例:
mvn -Daether.artifactResolver.snapshotNormalization=false clean install
我正在使用以太来解决依赖关系。但是,如果快照依赖项的同一版本有多个时间戳,则它不会遵守时间戳,而是选择第一个可用的时间戳。如何使用以太读取时间戳?
我正在使用以下代码块来计算快照和发布版本
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 );
}
}
}
我通过配置以下会话实现了这一点 属性
aether.artifactResolver.snapshotNormalization=false
示例:
mvn -Daether.artifactResolver.snapshotNormalization=false clean install