[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aether-users] org.apache.maven... vs. org.sonatype... classes

While using Aether in a Mojo I came across multiple cases where Aether seems to duplicate Maven classes.

E.g.
  org.sonatype.aether.repository.ArtifactRepository
  org.apache.maven.artifact.repository.ArtifactRepository
or
  org.sonatype.aether.artifact.Artifact
  org.apache.maven.artifact.Artifact

I'm a bit confused about this.

I followed the examples from the Wiki [1] and evolved my code into a POM evaluator using an injected ProjectBuilder:

  DefaultProjectBuildingRequest req = new DefaultProjectBuildingRequest();
  req.setRepositorySession(repoSession);
  ProjectBuildingResult res = projectBuilder.build(new File(pomFile),req);

Here I realized that the request is not looking up the parent POM as intended.
I tried to add an org.sonatype...RemoteRepository to the request, but it's the wrong type.

  req.getRemoteRepositories().add(new RemoteRepository(...));

Probably I'm doing something fundamentally wrong here.

Can you shed some light on my problem?

Thanks!
-Max

[1] https://docs.sonatype.org/display/AETHER/Home