I am using Aether utility library to manage deppendencies. When I try to download the transitive dependencies for a maven artifact I get a
java.io.IOException: Invalid Content-Range header for partial download
error. I am using almost the same code from the aether example here https://github.com/eclipse/aether-demo/blob/master/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveTransitiveDependencies.java
/**
* Resolves the transitive (compile) dependencies of an artifact.
*/
public class ResolveTransitiveDependencies {
public static void main( String[] args )
throws Exception
{
System.out.println( "------------------------------------------------------------" );
System.out.println( ResolveTransitiveDependencies.class.getSimpleName() );
RepositorySystem system = Booter.newRepositorySystem();
RepositorySystemSession session = Booter.newRepositorySystemSession( system );
Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:1.0.0.v20140518" );
DependencyFilter classpathFlter = DependencyFilterUtils.classpathFilter( JavaScopes.COMPILE );
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot( new Dependency( artifact, JavaScopes.COMPILE ) );
collectRequest.setRepositories( Booter.newRepositories( system, session ) );
DependencyRequest dependencyRequest = new DependencyRequest( collectRequest, classpathFlter );
List<ArtifactResult> artifactResults =
system.resolveDependencies( session, dependencyRequest ).getArtifactResults();
for ( ArtifactResult artifactResult : artifactResults )
{
System.out.println( artifactResult.getArtifact() + " resolved to " + artifactResult.getArtifact().getFile() );
}
}
}