Class ContextOverrides.Builder
java.lang.Object
eu.maveniverse.maven.mima.context.ContextOverrides.Builder
- Enclosing class:
- ContextOverrides
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendRepositories(boolean appendRepositories) Iftrue, therepositories(List)provided non-null list will be appended to repositories coming from Maven (read from usersettings.xmlor current project), otherwise they are replacing them.build()Builds an immutable instance ofContextOverridesusing so far applied settings and configuration.checksumPolicy(ContextOverrides.ChecksumPolicy checksumPolicy) Sets the checksum update policy.configProperties(Map<String, Object> configProperties) Sets Maven Configuration Properties to be used.static ContextOverrides.Buildercreate()Creates a "default" builder instance (that will NOT discoversettings.xml).localRepository(Path localRepository) Deprecated.offline(boolean offline) Sets session offline.repositories(List<org.eclipse.aether.repository.RemoteRepository> repositories) Sets the list ofRemoteRepositoryinstance you want to use.repositoryListener(org.eclipse.aether.RepositoryListener repositoryListener) SetsRepositoryListenerinstance to be used.settingsXml(Path settingsXml) Deprecated.UsewithSettingsXmlOverride(Path)instead.snapshotUpdatePolicy(ContextOverrides.SnapshotUpdatePolicy snapshotUpdatePolicy) Sets the snapshot update policy.systemProperties(Map<String, String> systemProperties) Sets Maven System Properties to be used.transferListener(org.eclipse.aether.transfer.TransferListener transferListener) SetsTransferListenerinstance to be used.userProperties(Map<String, String> userProperties) Sets Maven User Properties to be used.withActiveProfileIds(List<String> activeProfileIds) Sets explicitly activated profile IDs.withBasedir(Path basedir) Sets basedir path, it must be non-nulland point to an existing directory.withEffectiveSettings(Object effectiveSettings) Sets Maven Effective Settings.withGlobalSettingsXmlOverride(Path globalSettingsXmlOverride) Overrides Maven Global settings.xml location.withInactiveProfileIds(List<String> inactiveProfileIds) Sets explicitly inactivated profile IDs.withLocalRepositoryOverride(Path localRepositoryOverride) Overrides Maven User local repository location.withMavenSystemHome(Path mavenSystemHome) Sets Maven System Home location.withMavenUserHome(Path mavenUserHome) Overrides Maven User Home, does not acceptnull.withSettingsSecurityXmlOverride(Path settingsSecurityXmlOverride) Deprecated.withSettingsXmlOverride(Path settingsXmlOverride) Deprecated.withUserSettings(boolean withUserSettings) Enables or disables use ofsettings.xml, used to find out location of local repository, authentication, remote repositories and many more.withUserSettingsSecurityXmlOverride(Path userSettingsSecurityXmlOverride) Overrides Maven User settings-security.xml location.withUserSettingsXmlOverride(Path userSettingsXmlOverride) Overrides Maven User settings.xml location.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
create
Creates a "default" builder instance (that will NOT discoversettings.xml).Note: if you want to obey "Maven environment", you must invoke
withUserSettings(boolean)withtrueparameter at least. -
withBasedir
Sets basedir path, it must be non-nulland point to an existing directory. If these are not met, this method will throw. Basedir by default is initialized withContextOverrides.DEFAULT_BASEDIRthat is "current working directory" of the process.- Since:
- 2.3.0
-
systemProperties
Sets Maven System Properties to be used. Users usually don't want to tamper with this.For defaults see
ContextOverrides.defaultSystemProperties(). -
userProperties
Sets Maven User Properties to be used. These override the Maven System Properties. -
configProperties
Sets Maven Configuration Properties to be used. These acceptObjectvalues, and may be used for advanced configuration of some Resolver aspect. Usually users don't want to tamper with these. -
repositories
public ContextOverrides.Builder repositories(List<org.eclipse.aether.repository.RemoteRepository> repositories) Sets the list ofRemoteRepositoryinstance you want to use. The list may replace or append the list of repositories coming from Maven, seeappendRepositories(boolean).If
withUserSettings(boolean)invoked withtrue, thesettings.xmldiscovered repositories (and many more) will be used to create context. Also, in case when MIMA runs within Maven, the current project repositories will be provided. -
appendRepositories
Iftrue, therepositories(List)provided non-null list will be appended to repositories coming from Maven (read from usersettings.xmlor current project), otherwise they are replacing them. Default isfalse. -
offline
Sets session offline. -
localRepository
Deprecated.UsewithLocalRepositoryOverride(Path)instead.Overrides the (default ot discovered) location of local repository. This path "wins" always, even ifwithUserSettings(boolean)was invoked withtrueand it contains alternate local repository path. -
snapshotUpdatePolicy
public ContextOverrides.Builder snapshotUpdatePolicy(ContextOverrides.SnapshotUpdatePolicy snapshotUpdatePolicy) Sets the snapshot update policy. -
checksumPolicy
Sets the checksum update policy. -
withUserSettings
Enables or disables use ofsettings.xml, used to find out location of local repository, authentication, remote repositories and many more. -
withActiveProfileIds
Sets explicitly activated profile IDs.- Since:
- 2.3.0
-
withInactiveProfileIds
Sets explicitly inactivated profile IDs.- Since:
- 2.3.0
-
settingsXml
Deprecated.UsewithSettingsXmlOverride(Path)instead.Overrides the default location ofsettings.xml. Setting this method only, without invokingwithUserSettings(boolean)withtrue, makes the passed in path to this method ignored. -
repositoryListener
public ContextOverrides.Builder repositoryListener(org.eclipse.aether.RepositoryListener repositoryListener) SetsRepositoryListenerinstance to be used. -
transferListener
public ContextOverrides.Builder transferListener(org.eclipse.aether.transfer.TransferListener transferListener) SetsTransferListenerinstance to be used. -
withMavenUserHome
Overrides Maven User Home, does not acceptnull.- Since:
- 2.1.0
-
withSettingsXmlOverride
Deprecated.Overrides Maven User settings.xml location.- Since:
- 2.1.0
-
withUserSettingsXmlOverride
Overrides Maven User settings.xml location.- Since:
- 2.3.0
-
withSettingsSecurityXmlOverride
Deprecated.Overrides Maven User settings-security.xml location.- Since:
- 2.1.0
-
withUserSettingsSecurityXmlOverride
public ContextOverrides.Builder withUserSettingsSecurityXmlOverride(Path userSettingsSecurityXmlOverride) Overrides Maven User settings-security.xml location.- Since:
- 2.3.0
-
withLocalRepositoryOverride
Overrides Maven User local repository location.- Since:
- 2.1.0
-
withGlobalSettingsXmlOverride
Overrides Maven Global settings.xml location.- Since:
- 2.3.0
-
withMavenSystemHome
Sets Maven System Home location.- Since:
- 2.1.0
-
withEffectiveSettings
Sets Maven Effective Settings.- Since:
- 2.3.0
-
build
Builds an immutable instance ofContextOverridesusing so far applied settings and configuration.
-
withLocalRepositoryOverride(Path)instead.