GrammarScope  4.0.0
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
grammarscope.generator.codedeps.Aether Class Reference
Collaboration diagram for grammarscope.generator.codedeps.Aether:
Collaboration graph
[legend]

Public Member Functions

 Aether (final RemoteRepository[] remotes, final File repo)
 
List< Artifact > resolve (final Artifact root, final String scope) throws DependencyResolutionException
 
List< Artifact > resolve (final Artifact root, final String scope, final DependencyFilter filter) throws DependencyResolutionException
 

Private Member Functions

List< Artifact > fetch (final RepositorySystemSession session, final DependencyRequest dreq) throws DependencyResolutionException
 
CollectRequest request (final Dependency root)
 
RepositorySystemSession session ()
 

Static Private Member Functions

static Collection< String > reps (final Collection< RemoteRepository > repos)
 

Private Attributes

final transient RemoteRepository[] remotes
 
final transient File localRepo
 
final transient RepositorySystem system = RepositorySystemBuilder.build()
 

Detailed Description

Resolver of dependencies for one artifact.

#143 This class should be @Immutable, but RemoteRepository is not immutable. Let's create a new class to encapsulate all necessary properties from RemoteRepository.

You need the following dependencies to have in classpath in order to to work with this class:

org.sonatype.aether:aether-api:1.13.1
org.apache.maven:maven-core:3.0.3
Author
Yegor Bugayenko (yegor.nosp@m.@tpc.nosp@m.2.com)
Version
$Id$
Since
0.1.6
See also
Aether 1.13.1 JavaDoc

Constructor & Destructor Documentation

◆ Aether()

grammarscope.generator.codedeps.Aether.Aether ( final RemoteRepository[]  remotes,
final File  repo 
)

Public ctor, requires information about all remote repos and one local.

Parameters
remotesRemote repositories
repoLocal repository location (directory path)

Member Function Documentation

◆ fetch()

List<Artifact> grammarscope.generator.codedeps.Aether.fetch ( final RepositorySystemSession  session,
final DependencyRequest  dreq 
) throws DependencyResolutionException
private

Fetch dependencies. #51 This catch of NPE is a temporary measure. I don't know why Aether throws NPE in case of unresolvable artifact. This is the best I can do at the moment in order to protect clients of the class.

Parameters
sessionThe session
dreqDependency request
Returns
The list of dependencies
Exceptions
DependencyResolutionExceptionIf can't fetch it

◆ reps()

static Collection<String> grammarscope.generator.codedeps.Aether.reps ( final Collection< RemoteRepository >  repos)
staticprivate

Convert a list of repositories into a list of strings.

Parameters
reposThe list of them
Returns
The list of texts

◆ request()

CollectRequest grammarscope.generator.codedeps.Aether.request ( final Dependency  root)
private

Create collect request.

Parameters
rootThe root to start with
Returns
The request

◆ resolve() [1/2]

List<Artifact> grammarscope.generator.codedeps.Aether.resolve ( final Artifact  root,
final String  scope 
) throws DependencyResolutionException

List of transitive deps of the artifact. #51 This "filter IF NOT NULL" validation is a workaround, since I don't know what the actual problem is. Looks like sometimes (for some unknown reason) #classpathFilter() returns NULL. When exactly this may happen I have no idea. That's why this workaround. Sometime later we should do a proper testing and reproduce this defect in a test.

Parameters
rootThe artifact to work with
scopeThe scope to work with ("runtime", "test", etc.)
Returns
The list of dependencies
Exceptions
DependencyResolutionExceptionIf can't fetch it

◆ resolve() [2/2]

List<Artifact> grammarscope.generator.codedeps.Aether.resolve ( final Artifact  root,
final String  scope,
final DependencyFilter  filter 
) throws DependencyResolutionException

List of transitive deps of the artifact.

Parameters
rootThe artifact to work with
scopeThe scope to work with ("runtime", "test", etc.)
filterThe dependency filter to work with
Returns
The list of dependencies
Exceptions
DependencyResolutionExceptionIf can't fetch it

◆ session()

RepositorySystemSession grammarscope.generator.codedeps.Aether.session ( )
private

Create RepositorySystemSession.

Returns
The session

Member Data Documentation

◆ localRepo

final transient File grammarscope.generator.codedeps.Aether.localRepo
private

Location of local repo.

◆ remotes

final transient RemoteRepository [] grammarscope.generator.codedeps.Aether.remotes
private

Remote project repositories.

◆ system

final transient RepositorySystem grammarscope.generator.codedeps.Aether.system = RepositorySystemBuilder.build()
private

Repository system.


The documentation for this class was generated from the following file: