Interface Session

All Superinterfaces:
ProtoSession

@Experimental @ThreadSafe public interface Session extends ProtoSession
The session to install / deploy / resolve artifacts and dependencies.
Since:
4.0.0
  • Method Details

    • getMavenVersion

      @Nonnull Version getMavenVersion()
      Returns the current maven version.
      Returns:
      the maven version, never null
    • getSettings

      @Nonnull org.apache.maven.api.settings.Settings getSettings()
      Retrieves the settings for the current session.
      Returns:
      the settings instance
    • getToolchains

      @Nonnull Collection<org.apache.maven.api.toolchain.ToolchainModel> getToolchains()
      Retrieves toolchain models that have been explicitly configured.
      Returns:
      the toolchain models
    • getLocalRepository

      @Nonnull LocalRepository getLocalRepository()
      Retrieves the local repository associated with this session.
      Returns:
      the local repository instance
    • getRemoteRepositories

      @Nonnull List<RemoteRepository> getRemoteRepositories()
      Retrieves a list of remote repositories associated with this session.
      Returns:
      a list of remote repositories
    • getData

      @Nonnull SessionData getData()
      Retrieves the session data associated with this session.
      Returns:
      the session data, never null
    • getEffectiveProperties

      @Nonnull default Map<String,String> getEffectiveProperties()
      Default implementation at ProtoSession level, as the notion of project does not exist there.
      Specified by:
      getEffectiveProperties in interface ProtoSession
    • getEffectiveProperties

      @Nonnull Map<String,String> getEffectiveProperties(@Nullable Project project)
      Each invocation computes a new map of effective properties. To be used in interpolation.

      Effective properties are computed from system, user and optionally project properties, layered with defined precedence onto each other to achieve proper precedence. Precedence is defined as:

      • System properties (lowest precedence)
      • Project properties (optional)
      • User properties (highest precedence)
      Note: Project properties contains properties injected from profiles, if applicable. Their precedence is profile > project, hence active profile property may override project property.

      The caller of this method should decide whether there is a project in scope (hence, a project instance needs to be passed) or not.

      Parameters:
      project - Project or null.
      Returns:
      the effective properties, never null
    • getDegreeOfConcurrency

      int getDegreeOfConcurrency()
      Returns the degree of concurrency for the build.
      Returns:
      the degree of concurrency
    • getProjects

      @Nonnull List<Project> getProjects()
      Retrieves a list of projects associated with the session.
      Returns:
      a list of projects, never null
    • getPluginContext

      @Nonnull Map<String,Object> getPluginContext(@Nonnull Project project)
      Returns the plugin context for mojo being executed and the specified Project, never returns null as if context not present, creates it. Implementation note: while this method return type is Map, the returned map instance implements ConcurrentMap as well.
      Throws:
      MavenException - if not called from the within a mojo execution
    • getService

      @Nonnull <T extends Service> T getService(@Nonnull Class<T> clazz)
      Retrieves the service for the interface
      Throws:
      NoSuchElementException - if the service could not be found
    • withLocalRepository

      @Nonnull Session withLocalRepository(@Nonnull LocalRepository localRepository)
      Creates a derived session using the given local repository.
      Parameters:
      localRepository - the new local repository
      Returns:
      the derived session
      Throws:
      NullPointerException - if localRepository is null
    • withRemoteRepositories

      @Nonnull Session withRemoteRepositories(@Nonnull List<RemoteRepository> repositories)
      Creates a derived session using the given remote repositories.
      Parameters:
      repositories - the new list of remote repositories
      Returns:
      the derived session
      Throws:
      NullPointerException - if repositories is null
    • registerListener

      void registerListener(@Nonnull Listener listener)
      Register the given listener which will receive all events.
      Parameters:
      listener - the listener to register
      Throws:
      NullPointerException - if listener is null
    • unregisterListener

      void unregisterListener(@Nonnull Listener listener)
      Unregisters a previously registered listener.
      Parameters:
      listener - the listener to unregister
      Throws:
      NullPointerException - if listener is null
    • getListeners

      @Nonnull Collection<Listener> getListeners()
      Returns the list of registered listeners.
      Returns:
      an immutable collection of listeners, never null
    • createLocalRepository

      @Nonnull LocalRepository createLocalRepository(@Nonnull Path path)
      Shortcut for getService(RepositoryFactory.class).createLocal(...).
      Parameters:
      path - location of the local repository to create
      Returns:
      cache of artifacts downloaded from a remote repository or built locally
      See Also:
    • createRemoteRepository

      @Nonnull RemoteRepository createRemoteRepository(@Nonnull String id, @Nonnull String url)
      Shortcut for getService(RepositoryFactory.class).createRemote(...).
      Parameters:
      id - identifier of the remote repository to create
      url - location of the remote repository
      Returns:
      remote repository that can be used to download or upload artifacts
      See Also:
    • createRemoteRepository

      @Nonnull RemoteRepository createRemoteRepository(@Nonnull org.apache.maven.api.model.Repository repository)
      Shortcut for getService(RepositoryFactory.class).createRemote(...).
      Parameters:
      repository - information needed for establishing connections with remote repository
      Returns:
      remote repository that can be used to download or upload artifacts
      See Also:
    • createArtifactCoordinates

      @Nonnull ArtifactCoordinates createArtifactCoordinates(@Nonnull String coordsString)
      Creates a coordinates out of string that is formatted like: <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>.

      Shortcut for getService(ArtifactFactory.class).create(...).

      Parameters:
      coordsString - the string having "standard" coordinates.
      Returns:
      coordinates used to point to the artifact
      See Also:
    • createArtifactCoordinates

      @Nonnull ArtifactCoordinates createArtifactCoordinates(String groupId, String artifactId, String version, String extension)
      Shortcut for getService(ArtifactFactory.class).create(...).
      Parameters:
      groupId - the group identifier, or null is unspecified
      artifactId - the artifact identifier, or null is unspecified
      version - the artifact version, or null is unspecified
      extension - the artifact extension, or null is unspecified
      Returns:
      coordinates used to point to the artifact
      See Also:
    • createArtifactCoordinates

      @Nonnull ArtifactCoordinates createArtifactCoordinates(String groupId, String artifactId, String version, String classifier, String extension, String type)
      Shortcut for getService(ArtifactFactory.class).create(...).
      Parameters:
      groupId - the group identifier, or null is unspecified
      artifactId - the artifact identifier, or null is unspecified
      version - the artifact version, or null is unspecified
      classifier - the artifact classifier, or null is unspecified
      extension - the artifact extension, or null is unspecified
      type - the artifact type, or null is unspecified
      Returns:
      coordinates used to point to the artifact
      See Also:
    • createArtifactCoordinates

      @Nonnull ArtifactCoordinates createArtifactCoordinates(@Nonnull Artifact artifact)
      Shortcut for getService(ArtifactFactory.class).create(...).
      Parameters:
      artifact - artifact from which to get coordinates
      Returns:
      coordinates used to point to the artifact
      See Also:
    • createDependencyCoordinates

      @Nonnull DependencyCoordinates createDependencyCoordinates(@Nonnull ArtifactCoordinates coordinates)
      Shortcut for getService(DependencyFactory.class).create(...).
      Parameters:
      coordinates - artifact coordinates to get as a dependency coordinates
      Returns:
      dependency coordinates for the given artifact
      See Also:
    • createDependencyCoordinates

      @Nonnull DependencyCoordinates createDependencyCoordinates(@Nonnull Dependency dependency)
      Shortcut for getService(DependencyFactory.class).create(...).
      Parameters:
      dependency - dependency for which to get the coordinates
      Returns:
      coordinates for the given dependency
      See Also:
    • createArtifact

      @Nonnull Artifact createArtifact(String groupId, String artifactId, String version, String extension)
      Shortcut for getService(ArtifactFactory.class).create(...).
      Parameters:
      groupId - the group identifier, or null is unspecified
      artifactId - the artifact identifier, or null is unspecified
      version - the artifact version, or null is unspecified
      extension - the artifact extension, or null is unspecified
      Returns:
      artifact with the given coordinates
      See Also:
    • createArtifact

      @Nonnull Artifact createArtifact(String groupId, String artifactId, String version, String classifier, String extension, String type)
      Shortcut for getService(ArtifactFactory.class).create(...).
      Parameters:
      groupId - the group identifier, or null is unspecified
      artifactId - the artifact identifier, or null is unspecified
      version - the artifact version, or null is unspecified
      classifier - the artifact classifier, or null is unspecified
      extension - the artifact extension, or null is unspecified
      type - the artifact type, or null is unspecified
      Returns:
      artifact with the given coordinates
      See Also:
    • createProducedArtifact

      @Nonnull ProducedArtifact createProducedArtifact(String groupId, String artifactId, String version, String extension)
      Shortcut for getService(ArtifactFactory.class).createProduced(...).
      Parameters:
      groupId - the group identifier, or null is unspecified
      artifactId - the artifact identifier, or null is unspecified
      version - the artifact version, or null is unspecified
      extension - the artifact extension, or null is unspecified
      Returns:
      artifact with the given coordinates
      See Also:
    • createProducedArtifact

      @Nonnull ProducedArtifact createProducedArtifact(String groupId, String artifactId, String version, String classifier, String extension, String type)
      Shortcut for getService(ArtifactFactory.class).createProduced(...).
      Parameters:
      groupId - the group identifier, or null is unspecified
      artifactId - the artifact identifier, or null is unspecified
      version - the artifact version, or null is unspecified
      classifier - the artifact classifier, or null is unspecified
      extension - the artifact extension, or null is unspecified
      type - the artifact type, or null is unspecified
      Returns:
      artifact with the given coordinates
      See Also:
    • resolveArtifact

      @Nonnull DownloadedArtifact resolveArtifact(@Nonnull ArtifactCoordinates coordinates)
      Shortcut for getService(ArtifactResolver.class).resolve(...).
      Parameters:
      coordinates - coordinates of the artifact to resolve
      Returns:
      requested artifact together with the path to its file
      Throws:
      ArtifactResolverException - if the artifact resolution failed
      See Also:
    • resolveArtifact

      @Nonnull DownloadedArtifact resolveArtifact(@Nonnull ArtifactCoordinates coordinates, List<RemoteRepository> repositories)
      Shortcut for getService(ArtifactResolver.class).resolve(...).
      Parameters:
      coordinates - coordinates of the artifact to resolve
      repositories - repositories to use, if null, the session repositories are used
      Returns:
      requested artifact together with the path to its file
      Throws:
      ArtifactResolverException - if the artifact resolution failed
      See Also:
    • resolveArtifacts

      @Nonnull Collection<DownloadedArtifact> resolveArtifacts(@Nonnull ArtifactCoordinates... coordinates)
      Shortcut for getService(ArtifactResolver.class).resolve(...).
      Parameters:
      coordinates - coordinates of all artifacts to resolve
      Returns:
      requested artifacts together with the paths to their files
      Throws:
      ArtifactResolverException - if the artifact resolution failed
      See Also:
    • resolveArtifacts

      @Nonnull Collection<DownloadedArtifact> resolveArtifacts(@Nonnull Collection<? extends ArtifactCoordinates> coordinates)
      Shortcut for getService(ArtifactResolver.class).resolve(...).
      Parameters:
      coordinates - coordinates of all artifacts to resolve
      Returns:
      requested artifacts together with the paths to their files
      Throws:
      ArtifactResolverException - if the artifact resolution failed
      See Also:
    • resolveArtifacts

      @Nonnull Collection<DownloadedArtifact> resolveArtifacts(@Nonnull Collection<? extends ArtifactCoordinates> coordinates, @Nullable List<RemoteRepository> repositories)
      Shortcut for getService(ArtifactResolver.class).resolve(...).
      Parameters:
      coordinates - coordinates of all artifacts to resolve
      repositories - repositories to use, if null, the session repositories are used
      Returns:
      requested artifacts together with the paths to their files
      Throws:
      ArtifactResolverException - if the artifact resolution failed
      See Also:
    • resolveArtifact

      @Nonnull DownloadedArtifact resolveArtifact(@Nonnull Artifact artifact)
      Shortcut for getService(ArtifactResolver.class).resolve(...).
      Parameters:
      artifact - the artifact to resolve
      Returns:
      requested artifact together with the path to its file
      Throws:
      ArtifactResolverException - if the artifact resolution failed
      See Also:
    • resolveArtifact

      @Nonnull DownloadedArtifact resolveArtifact(@Nonnull Artifact artifact, @Nullable List<RemoteRepository> repositories)
      Shortcut for getService(ArtifactResolver.class).resolve(...).
      Parameters:
      artifact - the artifact to resolve
      repositories - repositories to use, if null, the session repositories are used
      Returns:
      requested artifact together with the path to its file
      Throws:
      ArtifactResolverException - if the artifact resolution failed
      See Also:
    • resolveArtifacts

      @Nonnull Collection<DownloadedArtifact> resolveArtifacts(@Nonnull Artifact... artifacts)
      Shortcut for getService(ArtifactResolver.class).resolve(...).
      Parameters:
      artifacts - all artifacts to resolve
      Returns:
      requested artifacts together with the paths to their files
      Throws:
      ArtifactResolverException - if the artifact resolution failed
      See Also:
    • installArtifacts

      void installArtifacts(@Nonnull ProducedArtifact... artifacts)
      Shortcut for getService(ArtifactInstaller.class).install(...).
      Parameters:
      artifacts - the artifacts to install
      Throws:
      ArtifactInstallerException - if the artifacts installation failed
      See Also:
    • installArtifacts

      void installArtifacts(@Nonnull Collection<ProducedArtifact> artifacts)
      Shortcut for getService(ArtifactInstaller.class).install(...).
      Parameters:
      artifacts - the artifacts to install
      Throws:
      ArtifactInstallerException - if the artifacts installation failed
      See Also:
    • deployArtifact

      void deployArtifact(@Nonnull RemoteRepository repository, @Nonnull ProducedArtifact... artifacts)
      Shortcut for getService(ArtifactDeployer.class).deploy(...).
      Parameters:
      repository - the repository where to deploy artifacts
      artifacts - the artifacts to deploy
      Throws:
      ArtifactDeployerException - if the artifacts deployment failed
      See Also:
    • setArtifactPath

      void setArtifactPath(@Nonnull ProducedArtifact artifact, @Nonnull Path path)
      Shortcut for getService(ArtifactManager.class).setPath(...).
      Parameters:
      artifact - the artifact for which to associate a path
      path - path to associate to the given artifact
      See Also:
    • getArtifactPath

      @Nonnull Optional<Path> getArtifactPath(@Nonnull Artifact artifact)
      Shortcut for getService(ArtifactManager.class).getPath(...).
      Parameters:
      artifact - the artifact for which to get a path
      Returns:
      path associated to the given artifact
      See Also:
    • getPathForLocalArtifact

      Path getPathForLocalArtifact(@Nonnull Artifact artifact)
      Gets the relative path for a locally installed artifact. Note that the artifact need not actually exist yet at the returned location, the path merely indicates where the artifact would eventually be stored.

      Shortcut for getService(LocalArtifactManager.class).getPathForLocalArtitact(...).

      Parameters:
      artifact - the artifact for which to get a local path
      Returns:
      local path associated to the given artifact, or null if none
      See Also:
    • getPathForRemoteArtifact

      @Nonnull Path getPathForRemoteArtifact(@Nonnull RemoteRepository remote, @Nonnull Artifact artifact)
      Gets the relative path for an artifact cached from a remote repository. Note that the artifact need not actually exist yet at the returned location, the path merely indicates where the artifact would eventually be stored.

      Shortcut for getService(LocalArtifactManager.class).getPathForRemoteArtifact(...).

      Parameters:
      remote - the repository from where artifacts are downloaded
      artifact - the artifact for which to get a path
      Returns:
      path associated to the given artifact
      See Also:
    • isVersionSnapshot

      boolean isVersionSnapshot(@Nonnull String version)
      Checks whether a given artifact version is considered a SNAPSHOT or not.

      Shortcut for getService(ArtifactManager.class).isSnapshot(...).

      In case there is Artifact in scope, the recommended way to perform this check is use of Artifact.isSnapshot() instead.

      Parameters:
      version - artifact version
      Returns:
      whether the given version is a snapshot
      See Also:
    • collectDependencies

      @Nonnull Node collectDependencies(@Nonnull Artifact artifact, @Nonnull PathScope scope)
      Shortcut for getService(DependencyResolver.class).collect(...)
      Parameters:
      artifact - artifact for which to get the dependencies, including transitive ones
      scope - the {link PathScope} to collect dependencies, must not be null
      Returns:
      root node of the dependency graph for the given artifact
      Throws:
      DependencyResolverException - if the dependency collection failed
      See Also:
    • collectDependencies

      @Nonnull Node collectDependencies(@Nonnull Project project, @Nonnull PathScope scope)
      Shortcut for getService(DependencyResolver.class).collect(...)
      Parameters:
      project - project for which to get the dependencies, including transitive ones
      scope - the {link PathScope} to collect dependencies, must not be null
      Returns:
      root node of the dependency graph for the given project
      Throws:
      DependencyResolverException - if the dependency collection failed
      See Also:
    • collectDependencies

      @Nonnull Node collectDependencies(@Nonnull DependencyCoordinates dependency, @Nonnull PathScope scope)
      Collects the transitive dependencies of some artifacts and builds a dependency graph. Note that this operation is only concerned about determining the coordinates of the transitive dependencies and does not actually resolve the artifact files.

      Shortcut for getService(DependencyResolver.class).resolve(...)

      Parameters:
      dependency - dependency for which to get transitive dependencies
      scope - the {link PathScope} to collect dependencies, must not be null
      Returns:
      root node of the dependency graph for the given artifact
      Throws:
      DependencyResolverException - if the dependency collection failed
      See Also:
    • flattenDependencies

      @Nonnull List<Node> flattenDependencies(@Nonnull Node node, @Nonnull PathScope scope)
      Shortcut for getService(DependencyResolver.class).flatten(...).
      Parameters:
      node - node for which to get a flattened list
      scope - build path scope (main compile, test compile, etc.) of desired nodes
      Returns:
      flattened list of node with the given build path scope
      Throws:
      DependencyResolverException - if the dependency flattening failed
      See Also:
    • resolveDependencies

      @Nonnull List<Path> resolveDependencies(@Nonnull DependencyCoordinates dependencyCoordinates)
      Shortcut for getService(DependencyResolver.class).resolve(...).getPaths().
      Parameters:
      dependencyCoordinates - coordinates of the dependency for which to get the paths
      Returns:
      paths to the transitive dependencies of the given dependency
      See Also:
    • resolveDependencies

      @Nonnull List<Path> resolveDependencies(@Nonnull List<DependencyCoordinates> dependencyCoordinates)
      Shortcut for getService(DependencyResolver.class).resolve(...).getPaths().
      Parameters:
      dependencyCoordinates - coordinates of all dependency for which to get the paths
      Returns:
      paths to the transitive dependencies of the given dependencies
      See Also:
    • resolveDependencies

      @Nonnull List<Path> resolveDependencies(@Nonnull Project project, @Nonnull PathScope scope)
      Shortcut for getService(DependencyResolver.class).resolve(...).getPaths().
      Parameters:
      project - the project for which to get dependencies
      scope - build path scope (main compile, test compile, etc.) of desired paths
      Returns:
      paths to the transitive dependencies of the given project
      See Also:
    • resolveDependencies

      @Nonnull Map<PathType, List<Path>> resolveDependencies(@Nonnull DependencyCoordinates dependencyCoordinates, @Nonnull PathScope scope, @Nonnull Collection<PathType> desiredTypes)
      Shortcut for getService(DependencyResolver.class).resolve(...).getDispatchedPaths().
      Parameters:
      dependencyCoordinates - coordinates of the dependency for which to get the paths
      scope - build path scope (main compile, test compile, etc.) of desired paths
      desiredTypes - the type of paths to include in the result
      Returns:
      paths to the transitive dependencies of the given project
      See Also:
    • resolveDependencies

      @Nonnull Map<PathType, List<Path>> resolveDependencies(@Nonnull Project project, @Nonnull PathScope scope, @Nonnull Collection<PathType> desiredTypes)
      Shortcut for getService(DependencyResolver.class).resolve(...).getDispatchedPaths().
      Parameters:
      project - the project for which to get dependencies
      scope - build path scope (main compile, test compile, etc.) of desired paths
      desiredTypes - the type of paths to include in the result
      Returns:
      paths to the transitive dependencies of the given project
      See Also:
    • resolveVersion

      @Nonnull Version resolveVersion(@Nonnull ArtifactCoordinates artifact) throws VersionResolverException
      Resolves an artifact's meta version (if any) to a concrete version. For example, resolves "1.0-SNAPSHOT" to "1.0-20090208.132618-23".

      Shortcut for getService(VersionResolver.class).resolve(...)

      Parameters:
      artifact - the artifact for which to resolve the version
      Returns:
      resolved version of the given artifact
      Throws:
      VersionResolverException - if the resolution failed
      See Also:
    • resolveVersionRange

      @Nonnull List<Version> resolveVersionRange(@Nonnull ArtifactCoordinates artifact) throws VersionResolverException
      Expands a version range to a list of matching versions, in ascending order. For example, resolves "[3.8,4.0)" to "3.8", "3.8.1", "3.8.2". The returned list of versions is only dependent on the configured repositories and their contents. The supplied request may also refer to a single concrete version rather than a version range. In this case though, the result contains simply the (parsed) input version, regardless of the repositories and their contents.
      Parameters:
      artifact - the artifact for which to resolve the versions
      Returns:
      a list of resolved Versions.
      Throws:
      VersionRangeResolverException - if the resolution failed
      VersionResolverException
      See Also:
    • resolveVersionRange

      @Nonnull List<Version> resolveVersionRange(@Nonnull ArtifactCoordinates artifact, List<RemoteRepository> repositories) throws VersionResolverException
      Expands a version range to a list of matching versions, in ascending order. For example, resolves "[3.8,4.0)" to "3.8", "3.8.1", "3.8.2". The returned list of versions is only dependent on the configured repositories and their contents. The supplied request may also refer to a single concrete version rather than a version range. In this case though, the result contains simply the (parsed) input version, regardless of the repositories and their contents.
      Parameters:
      artifact - the artifact for which to resolve the versions
      repositories - the repositories to use, or the session repositories if null
      Returns:
      a list of resolved Versions.
      Throws:
      VersionRangeResolverException - if the resolution failed
      VersionResolverException
      See Also:
    • resolveHighestVersion

      @Nonnull Optional<Version> resolveHighestVersion(@Nonnull ArtifactCoordinates artifact, List<RemoteRepository> repositories) throws VersionResolverException
      Resolves the highest available version of a version range. The returned version is only dependent on the configured repositories and their contents. The supplied request may also refer to a single concrete version rather than a version range. In this case though, the result contains simply the (parsed) input version, regardless of the repositories and their contents.
      Parameters:
      artifact - the artifact for which to resolve the versions
      repositories - the repositories to use, or the session repositories if null
      Returns:
      the highest resolved Version.
      Throws:
      VersionRangeResolverException - if the resolution failed
      VersionResolverException
      See Also:
    • parseVersion

      @Nonnull Version parseVersion(@Nonnull String version)
      Parses the specified version string, for example "1.0".

      Shortcut for getService(VersionParser.class).parseVersion(...).

      Parameters:
      version - the version string to parse
      Returns:
      the version parsed from the given string
      Throws:
      VersionParserException - if the parsing failed
      See Also:
    • parseVersionRange

      @Nonnull VersionRange parseVersionRange(@Nonnull String versionRange)
      Parses the specified version range specification, for example "[1.0,2.0)".

      Shortcut for getService(VersionParser.class).parseVersionRange(...).

      Parameters:
      versionRange - the version string to parse
      Returns:
      the version range parsed from the given string
      Throws:
      VersionParserException - if the parsing failed
      See Also:
    • parseVersionConstraint

      @Nonnull VersionConstraint parseVersionConstraint(@Nonnull String versionConstraint)
      Parses the specified version constraint specification, for example "1.0" or "[1.0,2.0)".

      Shortcut for getService(VersionParser.class).parseVersionConstraint(...).

      Parameters:
      versionConstraint - the version string to parse
      Returns:
      the version constraint parsed from the given string
      Throws:
      VersionParserException - if the parsing failed
      See Also:
    • requireType

      @Nonnull Type requireType(@Nonnull String id)
      Obtain the Type from the specified id.

      Shortcut for getService(TypeRegistry.class).require(...).

      See Also:
    • requireLanguage

      @Nonnull Language requireLanguage(@Nonnull String id)
      Obtain the Language from the specified id.

      Shortcut for getService(LanguageRegistry.class).require(...).

      See Also:
    • requirePackaging

      @Nonnull Packaging requirePackaging(@Nonnull String id)
      Obtain the Packaging from the specified id.

      Shortcut for getService(PackagingRegistry.class).require(...).

      See Also:
    • requireProjectScope

      @Nonnull ProjectScope requireProjectScope(@Nonnull String id)
      Obtain the ProjectScope from the specified id.

      Shortcut for getService(ProjectScopeRegistry.class).require(...).

      See Also:
    • requireDependencyScope

      @Nonnull DependencyScope requireDependencyScope(@Nonnull String id)
      Obtain the DependencyScope from the specified id.

      Shortcut for DependencyScope.forId(...) with a verification that the given identifier exists.

      Parameters:
      id - the identifier of the scope (case-sensitive)
      Returns:
      the scope for the given identifier (never null)
      Throws:
      IllegalArgumentException - if the given identifier is not a known scope
      See Also:
    • requirePathScope

      @Nonnull PathScope requirePathScope(@Nonnull String id)
      Obtain the PathScope from the specified id.

      Shortcut for getService(PathScopeRegistry.class).require(...).

      See Also: