Class BootstrapMavenContextConfig<T extends BootstrapMavenContextConfig<?>>

    • Field Detail

      • localRepo

        protected String localRepo
      • offline

        protected Boolean offline
      • workspaceDiscovery

        protected boolean workspaceDiscovery
      • repoSystem

        protected org.eclipse.aether.RepositorySystem repoSystem
      • repoSession

        protected org.eclipse.aether.RepositorySystemSession repoSession
      • remoteRepos

        protected List<org.eclipse.aether.repository.RemoteRepository> remoteRepos
      • remotePluginRepos

        protected List<org.eclipse.aether.repository.RemoteRepository> remotePluginRepos
      • remoteRepoManager

        protected org.eclipse.aether.impl.RemoteRepositoryManager remoteRepoManager
      • alternatePomName

        protected String alternatePomName
      • userSettings

        protected File userSettings
      • artifactTransferLogging

        protected boolean artifactTransferLogging
      • rootProjectDir

        protected Path rootProjectDir
      • preferPomsFromWorkspace

        protected boolean preferPomsFromWorkspace
      • effectiveModelBuilder

        protected Boolean effectiveModelBuilder
      • wsModuleParentHierarchy

        protected Boolean wsModuleParentHierarchy
      • modelProvider

        protected Function<Path,​org.apache.maven.model.Model> modelProvider
    • Constructor Detail

      • BootstrapMavenContextConfig

        public BootstrapMavenContextConfig()
    • Method Detail

      • setLocalRepository

        public T setLocalRepository​(String localRepo)
        Local repository location
        Parameters:
        localRepo - local repository location
        Returns:
        this instance
      • setOffline

        public T setOffline​(boolean offline)
        Whether to operate offline
        Parameters:
        offline - whether to operate offline
        Returns:
      • setCurrentProject

        public T setCurrentProject​(LocalProject currentProject)
        Workspace in the context of which this configuration is being initialized
        Parameters:
        currentProject - current project
        Returns:
      • setWorkspaceDiscovery

        public T setWorkspaceDiscovery​(boolean workspaceDiscovery)
        Enables or disables workspace discovery. By default, workspace discovery is enabled, meaning that when the resolver is created in the context of a Maven project, the Maven's project POM configuration will be picked up by the resolver and all the local projects belonging to the workspace will be resolved at their original locations instead of the actually artifacts installed in the repository. Note, that if #workspace is provided, this setting will be ignored.
        Parameters:
        workspaceDiscovery - enables or disables workspace discovery
        Returns:
        this instance of the builder
      • setRepositorySystem

        public T setRepositorySystem​(org.eclipse.aether.RepositorySystem repoSystem)
        RepositorySystem that should be used by the resolver
        Parameters:
        repoSystem -
        Returns:
      • setRepositorySystemSession

        public T setRepositorySystemSession​(org.eclipse.aether.RepositorySystemSession repoSession)
        RepositorySystemSession that should be used by the resolver
        Parameters:
        repoSession - repository session
        Returns:
      • setRemoteRepositories

        public T setRemoteRepositories​(List<org.eclipse.aether.repository.RemoteRepository> remoteRepos)
        Remote repositories that should be used by the resolver
        Parameters:
        remoteRepos - remote repositories
        Returns:
      • setRemotePluginRepositories

        public T setRemotePluginRepositories​(List<org.eclipse.aether.repository.RemoteRepository> remotePluginRepos)
        Remote plugin repositories that should be used by the resolver
        Parameters:
        repoPluginRepos - remote plugin repositories
        Returns:
      • setRemoteRepositoryManager

        public T setRemoteRepositoryManager​(org.eclipse.aether.impl.RemoteRepositoryManager remoteRepoManager)
        Remote repository manager
        Parameters:
        remoteRepoManager -
        Returns:
      • setCurrentProject

        public T setCurrentProject​(String currentProject)
        The meaning of this option is equivalent to alternative POM in Maven, which can be specified with command line argument '-f'.
        Parameters:
        currentProject -
        Returns:
      • setUserSettings

        public T setUserSettings​(File userSettings)
        User Maven settings file location
        Parameters:
        userSettings -
        Returns:
      • setArtifactTransferLogging

        public T setArtifactTransferLogging​(boolean artifactTransferLogging)
        Whether to enable progress logging of artifact transfers. The default value is true.
        Parameters:
        artifactTransferLogging -
        Returns:
      • getPomForDirOrNull

        public Path getPomForDirOrNull​(Path basedir)
        Resolves a POM file for a basedir.
        Parameters:
        basedir - project's basedir
        Returns:
        POM file for the basedir or null, if it could not be resolved
      • setRootProjectDir

        public T setRootProjectDir​(Path rootProjectDir)
        Root project directory.
        Parameters:
        rootProjectDir - root project directory
        Returns:
        this instance
      • setPreferPomsFromWorkspace

        public T setPreferPomsFromWorkspace​(boolean preferPomsFromWorkspace)
        By default POM artifacts of modules with packaging other than pom are resolved from the workspace only if the main artifact has been built locally, otherwise both the main artifact and the POM will be resolved from a Maven repository (local and/or remote).

        Enabling this option will make the resolver ignore the fact that the main artifact hasn't been built yet and will pick up its pom from the workspace.

        Parameters:
        preferPomsFromWorkspace - whether the POM artifact should always be resolved from the workspace
        Returns:
        this instance
      • setEffectiveModelBuilder

        public T setEffectiveModelBuilder​(boolean effectiveModelBuilder)
        When workspace is loaded, the current implementation reads the POM files of every project found and initializes the workspace model based on the raw POMs. This approach has its limitations, e.g. it doesn't properly support interpolation of POMs, including properties and profiles. But it is relatively fast compared to the resolving the effective POMs.

        This option enables workspace initialization based on effective POMs of every found project.

        Parameters:
        effectiveModelBuilder - whether to enable effective model builder for workspace discovery
        Returns:
        this instance
      • setWorkspaceModuleParentHierarchy

        public T setWorkspaceModuleParentHierarchy​(boolean wsModuleParentHierarchy)
        Whether to enable initialization of the parent hierarchy for discovered WorkspaceModules. Enabling complete POM hierarchy is useful for project info and update use-cases but not really for runtime be it test or dev modes.

        Parameters:
        wsModuleParentHierarchy - whether to initialize parents for WorkspaceModule
        Returns:
        this instance
      • setProjectModelProvider

        public T setProjectModelProvider​(Function<Path,​org.apache.maven.model.Model> modelProvider)
        When workspace discovery is enabled, this method allows to set a POM provider that would return a Model for a given workspace module directory.
        Parameters:
        modelProvider - POM provider
        Returns:
        this instance