Class BootstrapMavenContextConfig<T extends BootstrapMavenContextConfig<?>>
- java.lang.Object
-
- io.quarkus.bootstrap.resolver.maven.BootstrapMavenContextConfig<T>
-
- Direct Known Subclasses:
MavenArtifactResolver.Builder
public class BootstrapMavenContextConfig<T extends BootstrapMavenContextConfig<?>> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected StringalternatePomNameprotected booleanartifactTransferLoggingprotected BootstrapMavenOptionscliOptionsprotected LocalProjectcurrentProjectprotected BooleaneffectiveModelBuilderprotected StringlocalRepoprotected Function<Path,org.apache.maven.model.Model>modelProviderprotected Booleanofflineprotected booleanpreferPomsFromWorkspaceprotected List<org.eclipse.aether.repository.RemoteRepository>remotePluginReposprotected org.eclipse.aether.impl.RemoteRepositoryManagerremoteRepoManagerprotected List<org.eclipse.aether.repository.RemoteRepository>remoteReposprotected org.eclipse.aether.RepositorySystemSessionrepoSessionprotected org.eclipse.aether.RepositorySystemrepoSystemprotected PathrootProjectDirprotected FileuserSettingsprotected booleanworkspaceDiscoveryprotected BooleanwsModuleParentHierarchy
-
Constructor Summary
Constructors Constructor Description BootstrapMavenContextConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PathgetPomForDirOrNull(Path basedir)Resolves a POM file for a basedir.TsetArtifactTransferLogging(boolean artifactTransferLogging)Whether to enable progress logging of artifact transfers.TsetCurrentProject(LocalProject currentProject)Workspace in the context of which this configuration is being initializedTsetCurrentProject(String currentProject)The meaning of this option is equivalent to alternative POM in Maven, which can be specified with command line argument '-f'.TsetEffectiveModelBuilder(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.TsetLocalRepository(String localRepo)Local repository locationTsetOffline(boolean offline)Whether to operate offlineTsetPreferPomsFromWorkspace(boolean preferPomsFromWorkspace)By default POM artifacts of modules with packaging other thanpomare 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).TsetProjectModelProvider(Function<Path,org.apache.maven.model.Model> modelProvider)When workspace discovery is enabled, this method allows to set a POM provider that would return aModelfor a given workspace module directory.TsetRemotePluginRepositories(List<org.eclipse.aether.repository.RemoteRepository> remotePluginRepos)Remote plugin repositories that should be used by the resolverTsetRemoteRepositories(List<org.eclipse.aether.repository.RemoteRepository> remoteRepos)Remote repositories that should be used by the resolverTsetRemoteRepositoryManager(org.eclipse.aether.impl.RemoteRepositoryManager remoteRepoManager)Remote repository managerTsetRepositorySystem(org.eclipse.aether.RepositorySystem repoSystem)RepositorySystem that should be used by the resolverTsetRepositorySystemSession(org.eclipse.aether.RepositorySystemSession repoSession)RepositorySystemSession that should be used by the resolverTsetRootProjectDir(Path rootProjectDir)Root project directory.TsetUserSettings(File userSettings)User Maven settings file locationTsetWorkspaceDiscovery(boolean workspaceDiscovery)Enables or disables workspace discovery.TsetWorkspaceModuleParentHierarchy(boolean wsModuleParentHierarchy)Whether to enable initialization of the parent hierarchy for discoveredWorkspaceModules.
-
-
-
Field Detail
-
localRepo
protected String localRepo
-
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
-
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
-
-
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#workspaceis 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 thanpomare 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
pomfrom 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 discoveredWorkspaceModules. 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 forWorkspaceModule- 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 aModelfor a given workspace module directory.- Parameters:
modelProvider- POM provider- Returns:
- this instance
-
-