Class BootstrapMavenContextConfig<T extends BootstrapMavenContextConfig<T>>

java.lang.Object
io.quarkus.bootstrap.resolver.maven.BootstrapMavenContextConfig<T>
Direct Known Subclasses:
MavenArtifactResolver.Builder

public class BootstrapMavenContextConfig<T extends BootstrapMavenContextConfig<T>> extends Object
  • Field Details

    • localRepo

      protected String localRepo
    • localRepoTail

      protected String[] localRepoTail
    • localRepoTailIgnoreAvailability

      protected Boolean localRepoTailIgnoreAvailability
    • offline

      protected Boolean offline
    • currentProject

      protected LocalProject currentProject
    • 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
    • settingsDecrypter

      protected org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter
    • alternatePomName

      protected String alternatePomName
    • userSettings

      protected File userSettings
    • artifactTransferLogging

      protected boolean artifactTransferLogging
    • cliOptions

      protected BootstrapMavenOptions cliOptions
    • rootProjectDir

      protected Path rootProjectDir
    • preferPomsFromWorkspace

      protected boolean preferPomsFromWorkspace
    • effectiveModelBuilder

      protected Boolean effectiveModelBuilder
    • wsModuleParentHierarchy

      protected Boolean wsModuleParentHierarchy
    • providedModules

      protected List<WorkspaceModulePom> providedModules
    • excludeSisuBeanPackages

      protected List<String> excludeSisuBeanPackages
    • includeSisuBeanPackages

      protected List<String> includeSisuBeanPackages
    • warnOnFailedWorkspaceModules

      protected Boolean warnOnFailedWorkspaceModules
  • Constructor Details

    • BootstrapMavenContextConfig

      public BootstrapMavenContextConfig()
  • Method Details

    • getEffectiveModelBuilderProperty

      public static boolean getEffectiveModelBuilderProperty(Properties props)
      Resolves the effective value of the effective-model-builder option by looking for the quarkus.bootstrap.effective-model-builder property among the system properties and, if not set, in the properties argument.

      If the property is found, the method will return the result of Boolean.parseBoolean(java.lang.String). If the property is not set, the method will return false.

      Parameters:
      props - primary source of properties
      Returns:
      whether effective model builder should be enabled
    • excludeSisuBeanPackage

      public T excludeSisuBeanPackage(String packageName)
    • getExcludeSisuBeanPackages

      protected List<String> getExcludeSisuBeanPackages()
    • includeSisuBeanPackage

      public T includeSisuBeanPackage(String packageName)
    • getIncludeSisuBeanPackages

      protected List<String> getIncludeSisuBeanPackages()
    • setLocalRepository

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

      public T setLocalRepositoryTail(String... localRepoTail)
      Local repository tail locations (comma-separated)
      Parameters:
      localRepoTail - local repository tail locations (comma-separated)
      Returns:
      this instance
    • setLocalRepositoryTailIgnoreAvailability

      public T setLocalRepositoryTailIgnoreAvailability(boolean localRepoTailIgnoreAvailability)
      Wheter to ignore availability on local repository tail (default: true)
      Parameters:
      localRepoTailIgnoreAvailability - whether to ignore availability on local repository tail
      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.
      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:
      remotePluginRepos - remote plugin repositories
      Returns:
    • setRemoteRepositoryManager

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

      public T setSettingsDecrypter(org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter)
      Settings decryptor
      Parameters:
      settingsDecrypter - settings decrypter
      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
    • addProvidedModule

      public T addProvidedModule(Path pomFile, org.apache.maven.model.Model rawModel, org.apache.maven.model.Model effectiveModel)
      When workspace discovery is enabled, this method allows providing POMs for a given workspace POM file. It doesn't have to be a complete list of modules.
      Parameters:
      pomFile - POM file, never nul
      rawModel - raw POM model or null
      effectiveModel - effective POM model or null
      Returns:
      this instance
    • setWarnOnFailedWorkspaceModules

      public T setWarnOnFailedWorkspaceModules(boolean warnOnFailedWorkspaceModules)
      Whether to warn about failures loading workspace modules instead of throwing errors
      Parameters:
      warnOnFailedWorkspaceModules - whether to warn about failures loading workspace modules instead of throwing errors
      Returns:
      this config instance