Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] Resolving test dependencies using aether

Hello Benjamin,

Sorry for the missing picture, but we did get it working. We
essentially resolve the artifact first and then use that resolved
artifact to get it's transitive dependencies. The code looks something
like this: https://gist.github.com/1310299

Thanks for all your help Benjamin.
--
Arthur Kalmenson



On Mon, Oct 24, 2011 at 4:48 PM, Benjamin Bentmann
<bentmann@xxxxxxxxxxxx> wrote:
> Arthur Kalmenson wrote:
>
>> Artifact artifact = new
>> DefaultArtifact("groupId","artifactId","tests","jars","version");
>
> I assume "jars" is a typo, it should read "jar".
>
>> (or
>> Map<String, String>  props = new HashMap<String, String>();
>> props.put("type","test-jar");
>> Artifact artifact = new DefaultArtifact("groupId:artifactId:version",
>> props);)
>
> The props provide meta information, they are not relevant for resolution
> which only considers an artifact's identity as given by groupId, artifactId,
> version, classifier and extension.
>
>>
>> ArtifactRequest artifactRequest = new ArtifactRequest();
>> artifactRequest.setArtifact(artifact);
>> artifactRequest.addRepository(repository);
>> ArtifactResult resolvedArtifact = system.resolveArtifact(session,
>> artifactRequest);
>> Artifact file = resolvedArtifact.getArtifact();
>>
>> But that doesn't download the test jar. Do you happen to know how we
>> would get aether to resolve the test-jar?
>
> If it doesn't download the test jar, what does it then? It's hard to help if
> half of the picture is missing. The code you sketched should generally work,
> there's nothing special to a test-jar, it's a plain JAR artifact with a
> classifier.
>
>
> Benjamin
> _______________________________________________
> aether-users mailing list
> aether-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aether-users
>


Back to the top