Class Context

java.lang.Object
eu.maveniverse.maven.mima.context.Context
All Implemented Interfaces:
Closeable, AutoCloseable

public final class Context extends Object implements Closeable
The MIMA context holds references to RepositorySystem, RepositorySystemSession and list of RemoteRepository. Context is Closeable, ideally used in try-with-resource constructs.

The very first context instance application creates using Runtime.create(ContextOverrides) is called "root context", and creation of it can be considered "heavy" operation (runtime dependent). Root context should be kept open as long as application is expected to make use of Resolver.

Context instances may be customized with customize(ContextOverrides) method, in that case the returned context is "derived" from this context. In those cases the context instances should be handled "as nested", so closed in opposite order as they were obtained. Creating customized contexts can be considered "light" operation, as they merely alter the RepositorySystemSession instance and repositories, while the RepositorySystem is just inherited from this instance (is not reconstructed).

See Also:
  • Constructor Details

    • Context

      public Context(RuntimeSupport runtime, ContextOverrides contextOverrides, org.eclipse.aether.RepositorySystem repositorySystem, org.eclipse.aether.RepositorySystemSession repositorySystemSession, List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories, Runnable managedCloser)
  • Method Details